summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@proxience.com>2015-11-18 12:08:11 +0100
committerÉtienne Loks <etienne.loks@proxience.com>2015-11-18 12:08:11 +0100
commitc994efddf114d8caea116f2b076e2826303ba2e2 (patch)
tree7c41353a944851dd24dd65efb59eb177b69e2f9d
parent7d0b6602984035351882e886271e6dee3674d6b0 (diff)
downloadIshtar-c994efddf114d8caea116f2b076e2826303ba2e2.tar.bz2
Ishtar-c994efddf114d8caea116f2b076e2826303ba2e2.zip
Finds: change base find index
-rw-r--r--archaeological_finds/models.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/archaeological_finds/models.py b/archaeological_finds/models.py
index d4ee70c23..fe06b82bc 100644
--- a/archaeological_finds/models.py
+++ b/archaeological_finds/models.py
@@ -482,8 +482,10 @@ class Find(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem):
self.save()
for base_find in self.base_finds.all():
if not base_find.index:
- idx = BaseFind.objects\
- .filter(context_record=base_find.context_record)\
+ cond = {
+ 'context_record__operation':
+ base_find.context_record.operation}
+ idx = BaseFind.objects.filter(**cond)\
.aggregate(Max('index'))
base_find.index = 1
if idx and idx['index__max']: