Return change set
This commit is contained in:
@@ -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']
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user