diff options
Diffstat (limited to 'archaeological_finds/models_finds.py')
-rw-r--r-- | archaeological_finds/models_finds.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py index f4056cf4b..5b980a590 100644 --- a/archaeological_finds/models_finds.py +++ b/archaeological_finds/models_finds.py @@ -1993,6 +1993,10 @@ class Find(BulkUpdatedItem, ValueGetter, DocumentItem, BaseHistorizedItem, if data: for k in data: setattr(new, k, data[k]) + # remove associated treatments + if not duplicate_for_treatment and ( + new.upstream_treatment or new.downstream_treatment): + new.upstream_treatment, new.downstream_treatment = None, None new.save() # m2m fields @@ -2023,6 +2027,8 @@ class Find(BulkUpdatedItem, ValueGetter, DocumentItem, BaseHistorizedItem, user=user, data={"label": new.label, "external_id": None})) # remove documents for this kind of duplicate (data entry) new.documents.clear() + # remove associated treatments + new.treatments.clear() return new @classmethod |