From bc0f49f391c335f763dc4614f4e7b647742bded4 Mon Sep 17 00:00:00 2001 From: Joel Addison Date: Sun, 15 Dec 2019 16:02:44 +1000 Subject: [PATCH] Fix presentation detail Do not retrieve schedule if it does not exist for proposal kind section. Do not show slot information if slot is not assigned. --- .../templates/symposion/schedule/presentation_detail.html | 8 +++++++- vendor/symposion/schedule/views.py | 5 ++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/pinaxcon/templates/symposion/schedule/presentation_detail.html b/pinaxcon/templates/symposion/schedule/presentation_detail.html index e91421be..e6ecf940 100644 --- a/pinaxcon/templates/symposion/schedule/presentation_detail.html +++ b/pinaxcon/templates/symposion/schedule/presentation_detail.html @@ -8,7 +8,13 @@ {% block head_title %}Presentation: {{ presentation.title }}{% endblock %} {% block page_title %}{{ presentation.title }}{% endblock %} -{% block page_lead %}{{ presentation.slot.rooms.0 }} | {{ presentation.slot.day.date|date:"D d M" }} | {{ presentation.slot.start}}–{{ presentation.slot.end }}{% endblock %} +{% block page_lead %} +{% if presentation.slot %} +{{ presentation.slot.rooms.0 }} | {{ presentation.slot.day.date|date:"D d M" }} | {{ presentation.slot.start }}–{{ presentation.slot.end }} +{% else %} +Not currently scheduled. +{% endif %} +{% endblock %} {% block content %} {% if presentation.unpublish %} diff --git a/vendor/symposion/schedule/views.py b/vendor/symposion/schedule/views.py index 99f3bf2c..275b9bf5 100644 --- a/vendor/symposion/schedule/views.py +++ b/vendor/symposion/schedule/views.py @@ -186,12 +186,15 @@ def schedule_presentation_detail(request, pk): presentation = get_object_or_404(Presentation, pk=pk) + schedule = None if presentation.slot: # 1) Schedule from presentation's slot schedule = presentation.slot.day.schedule else: # 2) Fall back to the schedule for this proposal - schedule = presentation.proposal.kind.section.schedule + section = presentation.proposal.kind.section + if hasattr(section, 'schedule'): + schedule = presentation.proposal.kind.section.schedule if not request.user.is_staff: # 3) Is proposal unpublished?