Return change set

This commit is contained in:
wqy
2022-09-17 20:36:23 +08:00
parent 35c5881114
commit 6ebaa21a7c
2 changed files with 3 additions and 3 deletions

View File

@@ -123,7 +123,7 @@ def delete_node(name: str, node_type: str, id: str, table_sql: str, table_undo_s
cur.execute(f"select * from coordinates where node = '{id}'")
row = cur.fetchone()
if row == None:
return
return ChangeSet()
coord = row['coord']

View File

@@ -75,11 +75,11 @@ def get_valve_minor_loss(name: str, id: str) -> float | None:
def _set_valve(name: str, id: str, key: str, key_type: str, value: str, optional: bool = False) -> ChangeSet:
if not is_valve(name, id):
return
return ChangeSet()
row = _get_valve(name, id)
if row == None:
return
return ChangeSet()
return update(name, VALVE, 'valves', 'id', id, key, key_type, row[key], value, optional)