summaryrefslogtreecommitdiff
path: root/archaeological_finds
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
commit6a6bac163a6ad1420e56ec9c476d11008cf09900 (patch)
tree7c41353a944851dd24dd65efb59eb177b69e2f9d /archaeological_finds
parent67f4bc08a7191c2558acf5b2c934113a26f7ff7c (diff)
downloadIshtar-6a6bac163a6ad1420e56ec9c476d11008cf09900.tar.bz2
Ishtar-6a6bac163a6ad1420e56ec9c476d11008cf09900.zip
Finds: change base find index
Diffstat (limited to 'archaeological_finds')
-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']: