summaryrefslogtreecommitdiff
path: root/ishtar_common
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common')
-rw-r--r--ishtar_common/models.py8
-rw-r--r--ishtar_common/views.py1
2 files changed, 5 insertions, 4 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py
index 9e48df8d2..29dedd113 100644
--- a/ishtar_common/models.py
+++ b/ishtar_common/models.py
@@ -235,7 +235,7 @@ class OwnPerms:
return cls.objects.filter(query).count()
@classmethod
- def get_owns(cls, user, extra_query={}):
+ def get_owns(cls, user, replace_query={}):
"""
Get Own items
"""
@@ -247,11 +247,11 @@ class OwnPerms:
if hasattr(cls, 'BASKET_MODEL'):
items = list(cls.BASKET_MODEL.objects.filter(user=user).all())
query = cls.get_query_owns(user)
- if not query:
+ if not query and not replace_query:
return cls.objects.filter(pk__isnull=True)
q = cls.objects.filter(query)
- if extra_query:
- q = q.filter(**extra_query)
+ if replace_query:
+ q = cls.objects.filter(**replace_query)
items += list(q.order_by(*cls._meta.ordering).all())
return items
diff --git a/ishtar_common/views.py b/ishtar_common/views.py
index 5022aa08e..95c4dbd76 100644
--- a/ishtar_common/views.py
+++ b/ishtar_common/views.py
@@ -236,6 +236,7 @@ def shortcut_menu(request):
if not new_selected_item and current:
try:
item = model.objects.get(pk=int(current))
+ new_selected_item = item
items.append((item.pk, shortify(unicode(item), 60),
True, item.get_short_menu_class()))
except (model.DoesNotExist, ValueError):