summaryrefslogtreecommitdiff
path: root/archaeological_warehouse/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_warehouse/models.py')
-rw-r--r--archaeological_warehouse/models.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/archaeological_warehouse/models.py b/archaeological_warehouse/models.py
index 2c6feaffc..d692f3dd9 100644
--- a/archaeological_warehouse/models.py
+++ b/archaeological_warehouse/models.py
@@ -1717,8 +1717,12 @@ class Container(
return None, error_msg
return
current_localisation = Container.objects.create(**dct)
+ current_localisation_id = current_localisation.id
+ # do not use save is query friendly
+ self.__class__.objects.filter(pk=self.id).update(
+ parent_id=current_localisation_id)
+ # update the cached value of the parent - safer for post-treatments
self.parent = current_localisation
- self.save()
if return_errors:
return current_localisation, None
return current_localisation
@@ -1990,12 +1994,12 @@ class Container(
for find in self.finds.all():
updated = find.update_current_full_location(full_location)
if updated:
- find.skip_history_when_saving = True
+ find.no_post_process()
find.save()
for find in self.finds_ref.all():
updated = find.update_ref_full_location(full_location)
if updated:
- find.skip_history_when_saving = True
+ find.no_post_process()
find.save()
def pre_save(self):