Пример #1
0
def test_agenda_permission_is_agenda_visible(is_public, show_schedule,
                                             has_schedule, result, event):
    event.is_public = is_public
    event.settings.show_schedule = show_schedule
    if has_schedule:
        event.release_schedule('42')
    assert is_agenda_visible(None, event) is result
Пример #2
0
 def public_slots(self):
     """All publicly visible :class:`~pretalx.schedule.models.slot.TalkSlot` objects of this submission in the current :class:`~pretalx.schedule.models.schedule.Schedule`."""
     from pretalx.agenda.permissions import is_agenda_visible
     if not is_agenda_visible(None, self.event):
         return []
     if not self.event.current_schedule:
         return []
     return self.event.current_schedule.talks.filter(submission=self,
                                                     is_visible=True)