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.
This commit is contained in:
parent
eb1193b265
commit
bc0f49f391
2 changed files with 11 additions and 2 deletions
|
@ -8,7 +8,13 @@
|
||||||
|
|
||||||
{% block head_title %}Presentation: {{ presentation.title }}{% endblock %}
|
{% block head_title %}Presentation: {{ presentation.title }}{% endblock %}
|
||||||
{% block page_title %}{{ 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 %}
|
||||||
|
<em>Not currently scheduled.</em>
|
||||||
|
{% endif %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% if presentation.unpublish %}
|
{% if presentation.unpublish %}
|
||||||
|
|
5
vendor/symposion/schedule/views.py
vendored
5
vendor/symposion/schedule/views.py
vendored
|
@ -186,12 +186,15 @@ def schedule_presentation_detail(request, pk):
|
||||||
|
|
||||||
presentation = get_object_or_404(Presentation, pk=pk)
|
presentation = get_object_or_404(Presentation, pk=pk)
|
||||||
|
|
||||||
|
schedule = None
|
||||||
if presentation.slot:
|
if presentation.slot:
|
||||||
# 1) Schedule from presentation's slot
|
# 1) Schedule from presentation's slot
|
||||||
schedule = presentation.slot.day.schedule
|
schedule = presentation.slot.day.schedule
|
||||||
else:
|
else:
|
||||||
# 2) Fall back to the schedule for this proposal
|
# 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:
|
if not request.user.is_staff:
|
||||||
# 3) Is proposal unpublished?
|
# 3) Is proposal unpublished?
|
||||||
|
|
Loading…
Reference in a new issue