Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ietf/meeting/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -665,8 +665,8 @@ def prepare_timeslots_for_display(timeslots, rooms):
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,
Expand Down