diff --git a/ietf/meeting/templatetags/agenda_custom_tags.py b/ietf/meeting/templatetags/agenda_custom_tags.py index 0bdd9d222..e3dc79068 100644 --- a/ietf/meeting/templatetags/agenda_custom_tags.py +++ b/ietf/meeting/templatetags/agenda_custom_tags.py @@ -72,7 +72,7 @@ def webcal_url(context, viewname, *args, **kwargs): @register.simple_tag def assignment_display_name(assignment): """Get name for an assignment""" - if assignment.session.type.slug == 'session' and assignment.session.historic_group: + if assignment.session.type.slug == 'regular' and assignment.session.historic_group: return assignment.session.historic_group.name return assignment.session.name or assignment.timeslot.name diff --git a/ietf/meeting/templatetags/tests.py b/ietf/meeting/templatetags/tests.py index 2734a57cd..270bc2eb0 100644 --- a/ietf/meeting/templatetags/tests.py +++ b/ietf/meeting/templatetags/tests.py @@ -3,7 +3,7 @@ from django.template import Context, Template -from ietf.meeting.factories import TimeSlotFactory +from ietf.meeting.factories import FloorPlanFactory, RoomFactory, TimeSlotFactory from ietf.meeting.templatetags.agenda_custom_tags import AnchorNode from ietf.utils.test_utils import TestCase @@ -23,10 +23,12 @@ class AgendaCustomTagsTests(TestCase): pass # any other failure ok since we used garbage inputs def test_location_anchor_node(self): + floorplan = FloorPlanFactory(meeting__type_id='ietf') + room = RoomFactory(meeting=floorplan.meeting, floorplan=floorplan) context = Context({ - 'no_location': TimeSlotFactory(location='none'), - 'no_show_location': TimeSlotFactory(show_location=False), - 'show_location': TimeSlotFactory(location__name='My Location'), + 'no_location': TimeSlotFactory(meeting=room.meeting, location='none'), + 'no_show_location': TimeSlotFactory(meeting=room.meeting, show_location=False), + 'show_location': TimeSlotFactory(meeting=room.meeting, location=room), }) template = Template(""" {% load agenda_custom_tags %}