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

@@ -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)