Merge pull request #123 from pydata/unpublished-schedule
Don't show unpublished schedule info to non-staff.
This commit is contained in:
commit
73a087c801
1 changed files with 6 additions and 0 deletions
|
@ -69,6 +69,8 @@ def schedule_detail(request, slug=None):
|
||||||
|
|
||||||
def schedule_list(request, slug=None):
|
def schedule_list(request, slug=None):
|
||||||
schedule = fetch_schedule(slug)
|
schedule = fetch_schedule(slug)
|
||||||
|
if not schedule.published and not request.user.is_staff:
|
||||||
|
raise Http404()
|
||||||
|
|
||||||
presentations = Presentation.objects.filter(section=schedule.section)
|
presentations = Presentation.objects.filter(section=schedule.section)
|
||||||
presentations = presentations.exclude(cancelled=True)
|
presentations = presentations.exclude(cancelled=True)
|
||||||
|
@ -82,6 +84,8 @@ def schedule_list(request, slug=None):
|
||||||
|
|
||||||
def schedule_list_csv(request, slug=None):
|
def schedule_list_csv(request, slug=None):
|
||||||
schedule = fetch_schedule(slug)
|
schedule = fetch_schedule(slug)
|
||||||
|
if not schedule.published and not request.user.is_staff:
|
||||||
|
raise Http404()
|
||||||
|
|
||||||
presentations = Presentation.objects.filter(section=schedule.section)
|
presentations = Presentation.objects.filter(section=schedule.section)
|
||||||
presentations = presentations.exclude(cancelled=True).order_by("id")
|
presentations = presentations.exclude(cancelled=True).order_by("id")
|
||||||
|
@ -169,6 +173,8 @@ def schedule_presentation_detail(request, pk):
|
||||||
presentation = get_object_or_404(Presentation, pk=pk)
|
presentation = get_object_or_404(Presentation, pk=pk)
|
||||||
if presentation.slot:
|
if presentation.slot:
|
||||||
schedule = presentation.slot.day.schedule
|
schedule = presentation.slot.day.schedule
|
||||||
|
if not schedule.published and not request.user.is_staff:
|
||||||
|
raise Http404()
|
||||||
else:
|
else:
|
||||||
schedule = None
|
schedule = None
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue