From d1d56b656b6058116160c563eb0e8e6741a18bb4 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 19 Apr 2017 18:40:32 +0200 Subject: Django 1.8: simplify ihtaruser management --- archaeological_context_records/models.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'archaeological_context_records') 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 -- cgit v1.2.3