Commit 5042c1ba authored by fred's avatar fred
Browse files

do not allow any episode under any emission

parent a6acb375
...@@ -113,9 +113,11 @@ class EpisodeDetailView(DetailView, EmissionMixin): ...@@ -113,9 +113,11 @@ class EpisodeDetailView(DetailView, EmissionMixin):
context['diffusions'] = Diffusion.objects.select_related().filter( context['diffusions'] = Diffusion.objects.select_related().filter(
episode=self.object.id).order_by('datetime') episode=self.object.id).order_by('datetime')
try: try:
context['emission'] = Emission.objects.get(slug=self.kwargs.get('emission_slug')) context['emission'] = context['episode'].emission
except Emission.DoesNotExist: except Emission.DoesNotExist:
raise Http404() raise Http404()
if self.kwargs.get('emission_slug') != context['emission'].slug:
raise Http404()
context.update(self.get_emission_context(context['emission'])) context.update(self.get_emission_context(context['emission']))
return context return context
episode = EpisodeDetailView.as_view() 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