From 02136acb286d0f6b97dcbc715138f085d59767ea Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 28 Mar 2017 13:17:29 +0200 Subject: Access control: fix get owns query for UEs, finds, warehouses and containers --- archaeological_context_records/models.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'archaeological_context_records/models.py') diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py index 4df56c49f..a16b4cae7 100644 --- a/archaeological_context_records/models.py +++ b/archaeological_context_records/models.py @@ -365,9 +365,10 @@ class ContextRecord(BaseHistorizedItem, ImageModel, OwnPerms, @classmethod def get_query_owns(cls, user): - return Q(operation__scientist=user.ishtaruser.person) |\ - Q(operation__in_charge=user.ishtaruser.person) |\ - Q(history_creator=user) + return (Q(operation__scientist=user.ishtaruser.person) | + Q(operation__in_charge=user.ishtaruser.person) | + Q(history_creator=user)) \ + & Q(operation__end_date__isnull=True) @classmethod def get_owns(cls, user, menu_filtr=None, limit=None, -- cgit v1.2.3