don't try to get main sound if episode is not defined
authorFrédéric Péters <fpeters@0d.be>
Mon, 15 Jun 2015 12:38:39 +0000 (14:38 +0200)
committerFrédéric Péters <fpeters@0d.be>
Mon, 15 Jun 2015 12:38:39 +0000 (14:38 +0200)
panikombo/models.py

index c587791..5c294bc 100644 (file)
@@ -59,7 +59,8 @@ class EpisodeCell(CellBase):
     def render(self, context):
         tmpl = template.loader.get_template('panikombo/episode.html')
         context['episode'] = self.episode
-        context['soundfile'] = self.episode.main_sound
+        if self.episode:
+            context['soundfile'] = self.episode.main_sound
         return tmpl.render(context)
 
     def get_included_items(self):