Fix error in assignment_display_name() and fix broken test from previous commit. Range 19665:19666 ready for merge.
- Legacy-Id: 19666
This commit is contained in:
parent
b77e6627a4
commit
347b62cbb5
|
@ -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
|
||||
|
||||
|
|
|
@ -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 %}
|
||||
|
|
Loading…
Reference in a new issue