From d5e26abe38f95f773f139a7d13a1ad51c241b4ad Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 25 Nov 2015 03:23:05 +0100 Subject: Finds: force regeneration of cached index values --- archaeological_finds/models.py | 8 ++++++-- 1 file 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 -- cgit v1.2.3