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.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/archaeological_warehouse/models.py b/archaeological_warehouse/models.py
index 5d06cefda..e67fe2bd2 100644
--- a/archaeological_warehouse/models.py
+++ b/archaeological_warehouse/models.py
@@ -1357,6 +1357,8 @@ class Container(DocumentItem, Merge, LightHistorizedItem,
return actions
def pre_save(self):
+ if self.parent == self:
+ self.parent = None
if not self.collection_id and not self.collection:
if self.location_id:
self.collection_id = self.location_id
@@ -1431,10 +1433,11 @@ class Container(DocumentItem, Merge, LightHistorizedItem,
def container_post_save(sender, **kwargs):
cached_label_and_geo_changed(sender=sender, **kwargs)
+ #TODO: to be deleted???
+ """
if not kwargs.get('instance'):
return
instance = kwargs.get('instance')
- #TODO: to be deleted???
for loca in ContainerLocalisation.objects.filter(
container=instance).exclude(
division__warehouse=instance.location).all():
@@ -1446,6 +1449,7 @@ def container_post_save(sender, **kwargs):
continue
loca.division = q.all()[0]
loca.save()
+ """
def container_pre_delete(sender, **kwargs):