Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 3 additions & 2 deletions ietf/meeting/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,8 +451,9 @@ class Room(models.Model):
# end floorplan-related stuff

def __str__(self):
return u"%s size: %s" % (self.name, self.capacity)

if len(self.functional_name) > 0 and self.functional_name != self.name:
return f"{self.name} [{self.functional_name}] (size: {self.capacity})"
return f"{self.name} (size: {self.capacity})"

def dom_id(self):
return "room%u" % (self.pk)
Expand Down
4 changes: 2 additions & 2 deletions ietf/meeting/tests_schedule_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,13 @@ def test_location_options(self):
rendered = str(TimeSlotEditForm(instance=ts)['location'])
# noinspection PyTypeChecker
self.assertInHTML(
f'<option value="{ts.location.pk}" selected>{ts.location.name} size: None</option>',
f'<option value="{ts.location.pk}" selected>{ts.location}</option>',
rendered,
)
for room in rooms:
# noinspection PyTypeChecker
self.assertInHTML(
f'<option value="{room.pk}">{room.name} size: {room.capacity}</option>',
f'<option value="{room.pk}">{room}</option>',
rendered,
)

Expand Down
1 change: 1 addition & 0 deletions ietf/templates/meeting/timeslot_edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ <h1>
<tr>
<th scope="row">
<span class="room-heading">{{ room.name }}
{% if room.functional_name and room.name != room.functional_name %} - {{ room.functional_name }}{% endif %}
{% if room.capacity %}<span class="capacity">({{ room.capacity }})</span>{% endif %}
</span>
</th>
Expand Down