home · contact · privacy
On removal of Conditions and Processes, also delete their VersionedAttributes.
authorChristian Heller <c.heller@plomlompom.de>
Sun, 28 Apr 2024 22:37:18 +0000 (00:37 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Sun, 28 Apr 2024 22:37:18 +0000 (00:37 +0200)
plomtask/conditions.py
plomtask/processes.py

index 337970924ab25305d64abef13afe24148b0209b1..45aa62b9b27a026c75549aea3350640c419d8a5e 100644 (file)
@@ -44,6 +44,8 @@ class Condition(BaseModel[int]):
                 table_name = f'{item}_{attr}'
                 for _ in db_conn.row_where(table_name, 'condition', self.id_):
                     raise HandledException('cannot remove Condition in use')
+        db_conn.delete_where('condition_titles', 'parent', self.id_)
+        db_conn.delete_where('condition_descriptions', 'parent', self.id_)
         super().remove(db_conn)
 
 
index e67b13414e26d40a87e77545ce57d238bc050028..0a9b95b3f5faf89fd5a4a9a0991c7bb9a70ca9c5 100644 (file)
@@ -177,6 +177,9 @@ class Process(BaseModel[int], ConditionsRelations):
         db_conn.delete_where('process_disables', 'process', self.id_)
         for step in self.explicit_steps:
             step.remove(db_conn)
+        db_conn.delete_where('process_titles', 'parent', self.id_)
+        db_conn.delete_where('process_descriptions', 'parent', self.id_)
+        db_conn.delete_where('process_efforts', 'parent', self.id_)
         super().remove(db_conn)