diff options
| -rw-r--r-- | archaeological_finds/models.py | 6 | 
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']: | 
