diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-04-19 18:40:32 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-04-19 18:41:04 +0200 |
commit | 80636d8cd2079d43bc69ff041409196798a0cf9b (patch) | |
tree | 86973a6761dfda4b6ccabcc0a5b084e291af6c60 /archaeological_context_records/models.py | |
parent | c6522eb812cd6caf6a8d9b776f9941dff8b6252d (diff) | |
download | Ishtar-80636d8cd2079d43bc69ff041409196798a0cf9b.tar.bz2 Ishtar-80636d8cd2079d43bc69ff041409196798a0cf9b.zip |
Django 1.8: simplify ihtaruser management
Diffstat (limited to 'archaeological_context_records/models.py')
-rw-r--r-- | archaeological_context_records/models.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py index 64859c185..678b0371d 100644 --- a/archaeological_context_records/models.py +++ b/archaeological_context_records/models.py @@ -361,11 +361,11 @@ class ContextRecord(BaseHistorizedItem, ImageModel, OwnPerms, return reverse('show-contextrecord', args=[self.pk, '']) @classmethod - def get_query_owns(cls, user): - return (Q(operation__scientist=user.ishtaruser.person) | - Q(operation__in_charge=user.ishtaruser.person) | - Q(operation__collaborators__pk=user.ishtaruser.person.pk) | - Q(history_creator=user)) \ + def get_query_owns(cls, ishtaruser): + return (Q(operation__scientist=ishtaruser.person) | + Q(operation__in_charge=ishtaruser.person) | + Q(operation__collaborators__pk=ishtaruser.person.pk) | + Q(history_creator=ishtaruser.user_ptr)) \ & Q(operation__end_date__isnull=True) @classmethod |