summaryrefslogtreecommitdiff
path: root/archaeological_context_records
diff options
context:
space:
mode:
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
commitc6835861d3b3575b25161eb13b8284b0da663ab8 (patch)
treea06e0b08aa038bd09be759a2d877f7d3eb34d0f9 /archaeological_context_records
parentfe6ad5563ba6b46a04653af00109b100d551a676 (diff)
downloadIshtar-c6835861d3b3575b25161eb13b8284b0da663ab8.tar.bz2
Ishtar-c6835861d3b3575b25161eb13b8284b0da663ab8.zip
Sources: fix query owns requests (refs #3196)
Diffstat (limited to 'archaeological_context_records')
-rw-r--r--archaeological_context_records/models.py9
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)