From 009659e8caff8281aac22efe1756957aa4b3e9b2 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 2 Jan 2017 15:33:56 +0100 Subject: Manage multiple condition for cascading shortcut menu - Manage shortcut menu for treatment and treatment files (refs #3384) --- archaeological_operations/models.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'archaeological_operations') diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index 7507da817..0270a0c74 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -377,9 +377,9 @@ class Operation(ClosedItem, BaseHistorizedItem, ImageModel, OwnPerms, @classmethod def get_owns(cls, user, menu_filtr=None, limit=None): - replace_query = {} - if menu_filtr: - replace_query = {'associated_file': menu_filtr} + replace_query = None + if menu_filtr and 'file' in menu_filtr: + replace_query = Q(associated_file=menu_filtr['file']) owns = super(Operation, cls).get_owns( user, replace_query=replace_query, limit=limit) -- cgit v1.2.3