Merge branch 'master' of https://e.coding.net/tjwater/tjwatercloud/TJWaterServer
This commit is contained in:
@@ -40,7 +40,7 @@ def delete_junction(name: str, id: str) -> ChangeSet:
|
||||
pattern = 'NULL' if row['pattern'] == None else row['pattern']
|
||||
pattern = f'"{pattern}"' if pattern != 'NULL' else pattern
|
||||
|
||||
cur.execute(f"select * from coordinates where id = '{id}'")
|
||||
cur.execute(f"select * from coordinates where node = '{id}'")
|
||||
row = cur.fetchone()
|
||||
if row == None:
|
||||
return
|
||||
@@ -53,9 +53,9 @@ def delete_junction(name: str, id: str) -> ChangeSet:
|
||||
cur.execute(sql)
|
||||
|
||||
redo = sql.replace("'", '"')
|
||||
undo = f'insert into _node (id, type) values ("{id}", "{type}");'
|
||||
undo += f" insert into junctions (id, elevation, demand, pattern) values ('{id}', {elevation}, {demand}, {pattern});"
|
||||
undo += f" insert into coordinates (node, coord) values ('{id}', '{coord}');"
|
||||
undo = f'insert into _node (id, type) values ("{id}", "JUNCTION");'
|
||||
undo += f' insert into junctions (id, elevation, demand, pattern) values ("{id}", {elevation}, {demand}, {pattern});'
|
||||
undo += f' insert into coordinates (node, coord) values ("{id}", "{coord}");'
|
||||
add_operation(name, redo, undo)
|
||||
|
||||
change = ChangeSet()
|
||||
|
||||
Reference in New Issue
Block a user