case insentive sorting #1087

This commit is contained in:
jokob-sk committed 2025-06-20 09:32:06 +10:00
1 parent 153383343b
commit 0034e49c1a
2 files changed
+3 -1

No files matched your search

View File
File mode changed.
+3 -1
View File
@@ -199,7 +199,9 @@ class Query(ObjectType):
for sort_option in options.sort:
devices_data = sorted(
devices_data,
key=lambda x: mixed_type_sort_key(x.get(sort_option.field)),
key=lambda x: mixed_type_sort_key(
x.get(sort_option.field).lower() if isinstance(x.get(sort_option.field), str) else x.get(sort_option.field)
),
reverse=(sort_option.order.lower() == "desc")
)