Skip to content

Commit 347b62c

Browse files
Fix error in assignment_display_name() and fix broken test from previous commit. Range 19665:19666 ready for merge.
- Legacy-Id: 19666
1 parent b77e662 commit 347b62c

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

ietf/meeting/templatetags/agenda_custom_tags.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def webcal_url(context, viewname, *args, **kwargs):
7272
@register.simple_tag
7373
def assignment_display_name(assignment):
7474
"""Get name for an assignment"""
75-
if assignment.session.type.slug == 'session' and assignment.session.historic_group:
75+
if assignment.session.type.slug == 'regular' and assignment.session.historic_group:
7676
return assignment.session.historic_group.name
7777
return assignment.session.name or assignment.timeslot.name
7878

ietf/meeting/templatetags/tests.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
from django.template import Context, Template
55

6-
from ietf.meeting.factories import TimeSlotFactory
6+
from ietf.meeting.factories import FloorPlanFactory, RoomFactory, TimeSlotFactory
77
from ietf.meeting.templatetags.agenda_custom_tags import AnchorNode
88
from ietf.utils.test_utils import TestCase
99

@@ -23,10 +23,12 @@ def test_anchor_node_subclasses_implement_resolve_url(self):
2323
pass # any other failure ok since we used garbage inputs
2424

2525
def test_location_anchor_node(self):
26+
floorplan = FloorPlanFactory(meeting__type_id='ietf')
27+
room = RoomFactory(meeting=floorplan.meeting, floorplan=floorplan)
2628
context = Context({
27-
'no_location': TimeSlotFactory(location='none'),
28-
'no_show_location': TimeSlotFactory(show_location=False),
29-
'show_location': TimeSlotFactory(location__name='My Location'),
29+
'no_location': TimeSlotFactory(meeting=room.meeting, location='none'),
30+
'no_show_location': TimeSlotFactory(meeting=room.meeting, show_location=False),
31+
'show_location': TimeSlotFactory(meeting=room.meeting, location=room),
3032
})
3133
template = Template("""
3234
{% load agenda_custom_tags %}

0 commit comments

Comments
 (0)