only include schedule if presentation has a slot

This commit is contained in:
Luke Hatcher 2013-01-03 03:44:49 -05:00
parent 9df85f24af
commit 97e1086b1d

View file

@ -145,9 +145,13 @@ def schedule_slot_edit(request, slug, slot_pk):
def schedule_presentation_detail(request, pk):
presentation = get_object_or_404(Presentation, pk=pk)
if presentation.slot:
schedule = presentation.slot.day.schedule
else:
schedule = None
ctx = {
"presentation": presentation,
"schedule": presentation.slot.day.schedule,
"schedule": schedule,
}
return render(request, "schedule/presentation_detail.html", ctx)