fix duplication of same objects in db with when saving a child scenario

This commit is contained in:
Dylan Jeannin committed 2026-05-19 16:13:21 +02:00
1 parent 348417977d
commit ccf3da114b
5 files changed
+17 -4

No files matched your search

@@ -274,6 +274,9 @@ class HydraulicStructure(SQLSubModel):
return hs
def _db_save(self, execute, data=None):
if not self.must_be_saved():
return True
execute(
"DELETE FROM hydraulic_structures " +
f"WHERE pamhyr_id = {self.pamhyr_id} " +