Skip to content

Commit 89e8fd9

Browse files
committed
fix: priority order not in list
1 parent 9da19c0 commit 89e8fd9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

modules/Drawbridge/commands/tournament.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,11 @@ def better_lambda(self, div):
7676

7777
try:
7878
return priority_order.index(div['division_name'])
79-
except:
80-
return div['division_id']
79+
except ValueError:
80+
# If not in priority list, sort alphanumerically by division_name
81+
return len(priority_order) + hash(str(div['division_name']))
82+
except Exception:
83+
return div.get('division_id', 9999)
8184

8285
async def update_launchpad(self):
8386
# purge all messages in the launchpad channel

0 commit comments

Comments
 (0)