fix: Sort rooms by ascending capacity in schedule editor (#5178)

* fix: Order rooms by ascending capacity in schedule editor

* chore: Revert unrelated changes accidentally included in commit
This commit is contained in:
Jennifer Richards 2023-02-21 12:18:13 -04:00 committed by GitHub
parent 0ce2b8ef54
commit 50601345aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -665,8 +665,8 @@ def edit_meeting_schedule(request, num=None, owner=None, name=None):
sorted_rooms = sorted(
rooms_with_timeslots,
key=lambda room: (
# Sort higher capacity rooms first.
-room.capacity if room.capacity is not None else 1, # sort rooms with capacity = None at end
# Sort lower capacity rooms first.
room.capacity if room.capacity is not None else math.inf, # sort rooms with capacity = None at end
# Sort regular session rooms ahead of others - these will usually
# have more timeslots than other room types.
0 if room_data[room.pk]['timeslot_count'] == max_timeslots else 1,