From 0e64d5cadef1d7b0ff4f0b105b379723a22f22f6 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 27 Aug 2020 11:17:51 +0200 Subject: Fix default sort for "own" items --- ishtar_common/models.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ishtar_common/models.py') diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 0d99ad4db..0e68bf7dd 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -446,14 +446,14 @@ class OwnPerms(object): if not values: if not get_short_menu_class: return sorted_values + list( - sorted(owns, key=lambda x: getattr(x, label_key))) + sorted(owns, key=lambda x: getattr(x, label_key) or "")) return sorted_values + list( - sorted(owns, key=lambda x: getattr(x[0], label_key))) + sorted(owns, key=lambda x: getattr(x[0], label_key) or "")) if not get_short_menu_class: return sorted_values + list( - sorted(owns, key=lambda x: x[label_key])) + sorted(owns, key=lambda x: x[label_key] or "")) return sorted_values + list( - sorted(owns, key=lambda x: x[0][label_key])) + sorted(owns, key=lambda x: x[0][label_key] or "")) @classmethod def get_owns(cls, user, replace_query=None, limit=None, values=None, -- cgit v1.2.3