Python3 fix: avoid None when sorting strings

This commit is contained in:
Helmut Merz 2025-02-23 10:29:25 +01:00
parent bbc277e81d
commit 0de7ef2550

View file

@ -182,7 +182,8 @@ class Concept(Contained, Persistent):
predicates = predicates is None and ['c*'] or predicates predicates = predicates is None and ['c*'] or predicates
relationships = [ConceptRelation(self, None, p) for p in predicates] relationships = [ConceptRelation(self, None, p) for p in predicates]
if sort == 'default': if sort == 'default':
sort = lambda x: (x.order, (x.second.title and x.second.title.lower())) sort = lambda x: (x.order or '',
(x.second.title and x.second.title.lower() or ''))
rels = (r for r in getRelations(self, child, relationships=relationships, rels = (r for r in getRelations(self, child, relationships=relationships,
usePredicateIndex=usePredicateIndex) usePredicateIndex=usePredicateIndex)
if canListObject(r.second, noSecurityCheck) and if canListObject(r.second, noSecurityCheck) and