diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-03-30 12:31:55 +0200 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-03-30 12:31:55 +0200 | 
| commit | 76b54a02373d58b630b3be4a76d6b6857806e3e2 (patch) | |
| tree | a06e0b08aa038bd09be759a2d877f7d3eb34d0f9 /archaeological_operations/models.py | |
| parent | dced4b8f3b540cf84f8e75041a680881b6a7e725 (diff) | |
| download | Ishtar-76b54a02373d58b630b3be4a76d6b6857806e3e2.tar.bz2 Ishtar-76b54a02373d58b630b3be4a76d6b6857806e3e2.zip  | |
Sources: fix query owns requests (refs #3196)
Diffstat (limited to 'archaeological_operations/models.py')
| -rw-r--r-- | archaeological_operations/models.py | 7 | 
1 files changed, 7 insertions, 0 deletions
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')),  | 
