diff options
Diffstat (limited to 'archaeological_context_records/models.py')
| -rw-r--r-- | archaeological_context_records/models.py | 9 | 
1 files changed, 9 insertions, 0 deletions
| diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py index bba9c643b..5e6b4622b 100644 --- a/archaeological_context_records/models.py +++ b/archaeological_context_records/models.py @@ -624,3 +624,12 @@ class ContextRecordSource(Source):      @property      def owner(self):          return self.context_record + +    @classmethod +    def get_query_owns(cls, user): +        return ( +            Q(context_record__operation__scientist=user.ishtaruser.person) | +            Q(context_record__operation__in_charge=user.ishtaruser.person) | +            Q(context_record__operation__collaborators__pk= +              user.ishtaruser.person.pk)) \ +               & Q(context_record__operation__end_date__isnull=True) | 
