summaryrefslogtreecommitdiff
path: root/archaeological_warehouse/models.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2020-09-24 16:02:27 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2021-02-28 12:15:20 +0100
commit2d35da2cd7c32dc0938d5235838d5488b319e8c9 (patch)
tree672a8a6e672b978962e9878fd046e9d313875ddd /archaeological_warehouse/models.py
parent9f6cd2687c6a859576b7ba19e7419c1e5847b2f3 (diff)
downloadIshtar-2d35da2cd7c32dc0938d5235838d5488b319e8c9.tar.bz2
Ishtar-2d35da2cd7c32dc0938d5235838d5488b319e8c9.zip
Container: fix parent field on form - prevent recursion on parent location fix
Diffstat (limited to 'archaeological_warehouse/models.py')
-rw-r--r--archaeological_warehouse/models.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/archaeological_warehouse/models.py b/archaeological_warehouse/models.py
index d30a90f56..096ff0b6c 100644
--- a/archaeological_warehouse/models.py
+++ b/archaeological_warehouse/models.py
@@ -853,7 +853,8 @@ class Container(DocumentItem, Merge, LightHistorizedItem, QRCodeItem, GeoItem,
@classmethod
def _change_child_location(cls, parent):
- for child in cls.objects.filter(parent=parent).all():
+ for child in cls.objects.filter(
+ parent=parent).exclude(location=parent.location).all():
if child.location != parent.location:
child.location = parent.location
child.save()