summaryrefslogtreecommitdiff
path: root/archaeological_finds/models.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2016-10-28 20:26:31 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2016-10-28 20:26:31 +0200
commitf296333a87085ee0e04a0f4fbfc207c112f17bce (patch)
tree3652f3dcb6991a052ec6a1c9ec2e89f0038a5cd0 /archaeological_finds/models.py
parent328de388cf7c8cd213752c01dfadc2a19e8acb6f (diff)
downloadIshtar-f296333a87085ee0e04a0f4fbfc207c112f17bce.tar.bz2
Ishtar-f296333a87085ee0e04a0f4fbfc207c112f17bce.zip
Force regeneration of cached labels when add M2M or changing ids
Diffstat (limited to 'archaeological_finds/models.py')
-rw-r--r--archaeological_finds/models.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/archaeological_finds/models.py b/archaeological_finds/models.py
index 5799d0e9a..aa5eacc30 100644
--- a/archaeological_finds/models.py
+++ b/archaeological_finds/models.py
@@ -269,6 +269,7 @@ class BaseFind(BaseHistorizedItem, OwnPerms):
self.auto_external_id = True
self.external_id = external_id
if updated:
+ self._cached_label_checked = False
self.save()
return returned
@@ -653,6 +654,7 @@ class Find(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem):
self.auto_external_id = True
self.external_id = external_id
if updated:
+ self._cached_label_checked = False
self.save()
return
@@ -671,6 +673,7 @@ class Find(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem):
self.index = q.aggregate(Max('index'))['index__max'] + 1
else:
self.index = 1
+ self._cached_label_checked = False
self.save()
for base_find in self.base_finds.filter(
context_record__operation__pk__isnull=False).all():
@@ -689,6 +692,7 @@ class Find(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem):
modified = True
if modified:
base_find.skip_history_when_saving = True
+ base_find._cached_label_checked = False
base_find.save()
# if not base_find.material_index:
# idx = BaseFind.objects\