diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-03-28 13:17:29 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-03-29 18:25:09 +0200 |
commit | 02136acb286d0f6b97dcbc715138f085d59767ea (patch) | |
tree | 72aaceee89f2fe1e30602314d2871bb433fd5a15 /archaeological_context_records/models.py | |
parent | 1e99edb16662266251fae93750e315d8b56593b3 (diff) | |
download | Ishtar-02136acb286d0f6b97dcbc715138f085d59767ea.tar.bz2 Ishtar-02136acb286d0f6b97dcbc715138f085d59767ea.zip |
Access control: fix get owns query for UEs, finds, warehouses and containers
Diffstat (limited to 'archaeological_context_records/models.py')
-rw-r--r-- | archaeological_context_records/models.py | 7 |
1 files changed, 4 insertions, 3 deletions
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, |