Fix demands undo bug
This commit is contained in:
@@ -44,8 +44,8 @@ def set_demand_cache(name: str, cs: ChangeSet) -> BatchSqlChangeSet:
|
||||
_undo_sql = f"delete from demands where junction = {f_junction};"
|
||||
for r in old['demands']:
|
||||
demand = float(r['demand'])
|
||||
pattern = str(r['pattern'])
|
||||
category = str(r['category'])
|
||||
pattern = str(r['pattern']) if 'pattern' in r and r['pattern'] != None else None
|
||||
category = str(r['category']) if 'category' in r and r['category'] != None else None
|
||||
f_demand = demand
|
||||
f_pattern = f"'{pattern}'" if pattern != None else 'null'
|
||||
f_category = f"'{category}'" if category != None else 'null'
|
||||
|
||||
Reference in New Issue
Block a user