Skip to content

Commit

Permalink
fix subconcepts sorted error
Browse files Browse the repository at this point in the history
  • Loading branch information
rayondemiel authored Feb 17, 2025
1 parent 206a887 commit 20a22e8
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions arches/app/models/concept.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,13 +222,21 @@ def get(
subconcept.relationshiptype = relation.relationtype_id
self.subconcepts.append(subconcept)

self.subconcepts = sorted(
self.subconcepts,
key=lambda concept: self.natural_keys(
try:
self.subconcepts = sorted(
self.subconcepts,
key=lambda concept: self.natural_keys(
concept.get_sortkey(lang)
),
reverse=False,
)
),
reverse=False,
)
except TypeError:
self.subconcepts = sorted(
self.subconcepts,
key=lambda concept: [str(k) for k in self.natural_keys(concept.get_sortkey(lang))],
reverse=False
)

# self.subconcepts = sorted(self.subconcepts, key=methodcaller(
# 'get_sortkey', lang=lang), reverse=False)

Expand Down

0 comments on commit 20a22e8

Please sign in to comment.