From 76b54a02373d58b630b3be4a76d6b6857806e3e2 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 30 Mar 2017 12:31:55 +0200 Subject: Sources: fix query owns requests (refs #3196) --- archaeological_operations/models.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'archaeological_operations') diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index 13997a632..d18181722 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -915,6 +915,13 @@ class OperationSource(Source): return u"{}-{:04d}".format(self.operation.code_patriarche or '', 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)) \ + & Q(operation__end_date__isnull=True) + class ActType(GeneralType): TYPE = (('F', _(u'Archaeological file')), -- cgit v1.2.3