diff options
Diffstat (limited to 'archaeological_operations/models.py')
| -rw-r--r-- | archaeological_operations/models.py | 18 | 
1 files changed, 9 insertions, 9 deletions
| diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index 0548c92e4..1ebf462a3 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -573,12 +573,12 @@ class Operation(ClosedItem, BaseHistorizedItem, ImageModel, OwnPerms,          return round(float(self.cost) / self.surface, 2)      @classmethod -    def get_query_owns(cls, user): +    def get_query_owns(cls, ishtaruser):          return ( -            Q(in_charge=user.ishtaruser.person) | -            Q(scientist=user.ishtaruser.person) | -            Q(collaborators__pk=user.ishtaruser.person.pk) | -            Q(history_creator=user)) & Q(end_date__isnull=True) +            Q(in_charge=ishtaruser.person) | +            Q(scientist=ishtaruser.person) | +            Q(collaborators__pk=ishtaruser.person.pk) | +            Q(history_creator=ishtaruser.user_ptr)) & Q(end_date__isnull=True)      def is_active(self):          return not bool(self.end_date) @@ -926,10 +926,10 @@ class OperationSource(Source):                                     self.index)      @classmethod -    def get_query_owns(cls, user): -        return (Q(operation__in_charge=user.ishtaruser.person) | -                Q(operation__scientist=user.ishtaruser.person) | -                Q(operation__collaborators__pk=user.ishtaruser.person.pk)) \ +    def get_query_owns(cls, ishtaruser): +        return (Q(operation__in_charge=ishtaruser.person) | +                Q(operation__scientist=ishtaruser.person) | +                Q(operation__collaborators__pk=ishtaruser.person.pk)) \                 & Q(operation__end_date__isnull=True) | 
