summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@proxience.com>2015-11-25 03:23:05 +0100
committerÉtienne Loks <etienne.loks@proxience.com>2015-11-25 03:23:05 +0100
commit57a24d859ed35f2faaea07e0d89f83eaebcc57af (patch)
tree77e2c6521e3d989b761ace89b25d2a393f5d761c
parent41b23774811e82c698effce9282a9cd8d8d61f39 (diff)
downloadIshtar-57a24d859ed35f2faaea07e0d89f83eaebcc57af.tar.bz2
Ishtar-57a24d859ed35f2faaea07e0d89f83eaebcc57af.zip
Finds: force regeneration of cached index values
-rw-r--r--archaeological_finds/models.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/archaeological_finds/models.py b/archaeological_finds/models.py
index 3cfa4b5e2..0006c29a7 100644
--- a/archaeological_finds/models.py
+++ b/archaeological_finds/models.py
@@ -484,11 +484,15 @@ class Find(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem):
modified = True
base_find.index = BaseFind.get_max_index(
base_find.context_record.operation) + 1
- if not base_find.cache_short_id:
+ if not base_find.cache_short_id or \
+ not base_find.cache_short_id.endswith(
+ unicode(base_find.index)):
base_find.cache_short_id = base_find.short_id()
if base_find.cache_short_id:
modified = True
- if not base_find.cache_complete_id:
+ if not base_find.cache_complete_id or \
+ not base_find.cache_complete_id.endswith(
+ unicode(base_find.index)):
base_find.cache_complete_id = base_find.complete_id()
if base_find.cache_complete_id:
modified = True