Skip to content

Commit

Permalink
Sort id_to_names output
Browse files Browse the repository at this point in the history
  • Loading branch information
eve-n0rman committed Apr 27, 2021
1 parent 240f473 commit 392bb17
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions structurebot/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def ids_to_names(ids):
dict: dict of id to name mappings
>>> ids_to_names([1073945516, 30003801])
{1073945516: 'n0rman', 30003801: 'Aunsou'}
{30003801: 'Aunsou', 1073945516: 'n0rman'}
>>> ids_to_names([1])
Traceback (most recent call last):
...
Expand All @@ -173,7 +173,7 @@ def ids_to_names(ids):
id_name.update({i.id: i.name for i in response.data})
elif response.status == 404:
raise HTTPError(response.data['error'])
return id_name
return dict(sorted(id_name.items()))


def notify_slack(messages):
Expand Down

0 comments on commit 392bb17

Please sign in to comment.