From ec49fcefb6e63eb7efb1bca59a1fc717769438c4 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Fri, 21 Oct 2016 12:08:50 +0200 Subject: Fix basket displaying in default menu (refs #3343) --- archaeological_finds/models.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/archaeological_finds/models.py b/archaeological_finds/models.py index 969e9b966..fcbeb2d25 100644 --- a/archaeological_finds/models.py +++ b/archaeological_finds/models.py @@ -634,7 +634,9 @@ class Find(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem): owns = super(Find, cls).get_owns( user, replace_query=replace_query, limit=limit) - return sorted(owns, key=lambda x: x.cached_label) + return sorted( + owns, key=lambda x: x.cached_label + if hasattr(x, 'cached_label') else unicode(x)) def _generate_cached_label(self): return unicode(self) -- cgit v1.2.3