Skip to content

Commit

Permalink
fix(ui): resource listing ignores case (#194)
Browse files Browse the repository at this point in the history
Signed-off-by: Lucas Eckhardt <[email protected]>
  • Loading branch information
lucaseck authored Mar 6, 2024
1 parent 377ad0c commit 223026a
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions src/deadline/client/ui/dialogs/deadline_config_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,10 @@ def __init__(self, parent=None):

def list_resources(self, config: Optional[ConfigParser]):
response = api.list_farms(config=config)
return sorted([(item["displayName"], item["farmId"]) for item in response["farms"]])
return sorted(
[(item["displayName"], item["farmId"]) for item in response["farms"]],
key=lambda item: (item[0].casefold(), item[1]),
)


class DeadlineQueueListComboBox(_DeadlineResourceListComboBox):
Expand All @@ -748,7 +751,10 @@ def list_resources(self, config: Optional[ConfigParser]):
default_farm_id = config_file.get_setting("defaults.farm_id", config=config)
if default_farm_id:
response = api.list_queues(config=config, farmId=default_farm_id)
return sorted([(item["displayName"], item["queueId"]) for item in response["queues"]])
return sorted(
[(item["displayName"], item["queueId"]) for item in response["queues"]],
key=lambda item: (item[0].casefold(), item[1]),
)
else:
return []

Expand Down Expand Up @@ -783,9 +789,12 @@ def list_resources(self, config: Optional[ConfigParser]):
}
)
return sorted(
(item["displayName"], item["storageProfileId"])
for item in storage_profiles
if self._get_current_os() == item["osFamily"]
[
(item["displayName"], item["storageProfileId"])
for item in storage_profiles
if self._get_current_os() == item["osFamily"]
],
key=lambda item: (item[0].casefold(), item[1]),
)
else:
return []
Expand Down

0 comments on commit 223026a

Please sign in to comment.