fix sort concept relations (Py3): use '' instead of None

This commit is contained in:
Helmut Merz 2025-03-09 11:26:48 +01:00
parent aa0443d0b5
commit ed5e560ba4
2 changed files with 2 additions and 2 deletions

View file

@ -445,7 +445,7 @@ class ConceptView(BaseView):
def parents(self): def parents(self):
rels = sorted(self.context.getParentRelations(), rels = sorted(self.context.getParentRelations(),
key=(lambda x: x.first.title and x.first.title.lower())) key=(lambda x: x.first.title and x.first.title.lower() or ''))
for r in rels: for r in rels:
yield self.childViewFactory(r, self.request) yield self.childViewFactory(r, self.request)

View file

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