Commit a6acb375 authored by fred's avatar fred
Browse files

raise 404 on episode of missing emission

parent 02686c7d
......@@ -6,6 +6,7 @@ import stat
import time
from django.conf import settings
from django.http import Http404
from django.views.decorators.cache import cache_control
from django.views.generic.base import TemplateView
......@@ -111,7 +112,10 @@ class EpisodeDetailView(DetailView, EmissionMixin):
context['sectionName'] = "Emissions"
context['diffusions'] = Diffusion.objects.select_related().filter('datetime')
context['emission'] = Emission.objects.get(slug=self.kwargs.get('emission_slug'))
context['emission'] = Emission.objects.get(slug=self.kwargs.get('emission_slug'))
except Emission.DoesNotExist:
raise Http404()
return context
episode = EpisodeDetailView.as_view()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment