Skip to content

Commit

Permalink
records_relations: Get sorting key from records_metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
sakshamarora1 authored and kpsherva committed May 13, 2024
1 parent 6736dcf commit f64dc74
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion invenio_app_ils/records_relations/retriever.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,10 @@ def get(self):
# Sort by the keys available in the data in order
if relation_type.sort_by:
relations.get(name, []).sort(
key=lambda rec: [rec.get(key) for key in relation_type.sort_by]
key=lambda rec: [
rec.get("record_metadata", {}).get(key)
for key in relation_type.sort_by
]
)

return relations
Expand Down

0 comments on commit f64dc74

Please sign in to comment.