@@ -646,8 +646,11 @@ def is_regular_agenda_item(assignment):
646646
647647 >>> any(is_regular_agenda_item(factory(t)) for t in ['plenary', 'break', 'reg', 'other', 'officehours'])
648648 False
649+
650+ >>> is_regular_agenda_item(None)
651+ False
649652 """
650- return assignment .slot_type ().slug == 'regular'
653+ return assignment is not None and assignment .slot_type ().slug == 'regular'
651654
652655@register .filter
653656def is_plenary_agenda_item (assignment ):
@@ -664,8 +667,11 @@ def is_plenary_agenda_item(assignment):
664667
665668 >>> any(is_plenary_agenda_item(factory(t)) for t in ['regular', 'break', 'reg', 'other', 'officehours'])
666669 False
670+
671+ >>> is_plenary_agenda_item(None)
672+ False
667673 """
668- return assignment .slot_type ().slug == 'plenary'
674+ return assignment is not None and assignment .slot_type ().slug == 'plenary'
669675
670676@register .filter
671677def is_special_agenda_item (assignment ):
@@ -682,8 +688,11 @@ def is_special_agenda_item(assignment):
682688
683689 >>> any(is_special_agenda_item(factory(t)) for t in ['regular', 'plenary'])
684690 False
691+
692+ >>> is_special_agenda_item(None)
693+ False
685694 """
686- return assignment .slot_type ().slug in [
695+ return assignment is not None and assignment .slot_type ().slug in [
687696 'break' ,
688697 'reg' ,
689698 'other' ,
@@ -711,7 +720,11 @@ def should_show_agenda_session_buttons(assignment):
711720 >>> test_cases.extend([('113', 'acme office hours'), ('150', 'acme office hours')])
712721 >>> all(should_show_agenda_session_buttons(factory(*tc)) for tc in test_cases)
713722 True
723+ >>> should_show_agenda_session_buttons(None)
724+ False
714725 """
726+ if assignment is None :
727+ return False
715728 num = assignment .meeting ().number
716729 if num .isdigit () and int (num ) <= settings .MEETING_LEGACY_OFFICE_HOURS_END :
717730 return not assignment .session .name .lower ().endswith (' office hours' )
0 commit comments