From 916920ad3dcc18c2c252698ee192c265743ab01a Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Fri, 9 Sep 2016 14:32:28 +0200 Subject: Shortcut menu: show all dependent items of pinned but not own parent item --- archaeological_operations/models.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'archaeological_operations') diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index 701ae4593..228e9859e 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -300,10 +300,11 @@ class Operation(ClosedItem, BaseHistorizedItem, ImageModel, OwnPerms, @classmethod def get_owns(cls, user, menu_filtr=None): - extra_query = {} + replace_query = {} if menu_filtr: - extra_query = {'associated_file': menu_filtr} - owns = super(Operation, cls).get_owns(user, extra_query=extra_query) + replace_query = {'associated_file': menu_filtr} + owns = super(Operation, cls).get_owns( + user, replace_query=replace_query) # owns = owns.annotate(null_count=Count('operation_code')) # return owns.order_by("common_name", "-year", "operation_code") return sorted(owns, key=lambda x: x.cached_label) -- cgit v1.2.3