fix: sort higher capacity rooms first in schedule editor (#4653)

* fix: handle rooms with capacity = None in schedule editor

* fix: sort higher capacity rooms ahead of lower

Sort was incorrect, this matches intent and comments.
This commit is contained in:
Jennifer Richards 2022-10-27 11:58:51 -03:00 committed by GitHub
parent b49d92e674
commit a3673f25cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -672,7 +672,7 @@ def edit_meeting_schedule(request, num=None, owner=None, name=None):
# timeslot structure will be neighbors. The grouping algorithm relies on this!
room_data[room.pk]['start_and_duration'],
# Within each group, sort higher capacity rooms first.
room.capacity,
-room.capacity if room.capacity is not None else 1, # sort rooms with capacity = None at end
# Finally, sort alphabetically by name
room.name
)