From: Guillaume Pellerin Date: Thu, 21 Apr 2016 15:19:37 +0000 (+0200) Subject: test video length X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=410f7e920bb706e50e73577c3b424fd59e21d789;p=mezzo.git test video length --- diff --git a/app/festival/models.py b/app/festival/models.py index 72267631..17fa9282 100644 --- a/app/festival/models.py +++ b/app/festival/models.py @@ -144,8 +144,9 @@ class Media(Displayable, RichText): elif self.closed_source_mime_type in source.attrib['type']: self.closed_source_url = source.attrib['src'] video = self.q('video') - if 'poster' in video[0].attrib.keys(): - self.poster_url = video[0].attrib['poster'] + if len(video): + if 'poster' in video[0].attrib.keys(): + self.poster_url = video[0].attrib['poster'] class Audio(Media):