From: Jan Szejko Date: Tue, 5 Jun 2018 15:26:04 +0000 (+0200) Subject: fix to pass tests X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/e79ef640becb4b59dba11c1dfcce0ea87000919b?ds=sidebyside fix to pass tests --- diff --git a/src/catalogue/models/book.py b/src/catalogue/models/book.py index 004c27e89..7cd6386ba 100644 --- a/src/catalogue/models/book.py +++ b/src/catalogue/models/book.py @@ -233,7 +233,7 @@ class Book(models.Model): def get_audio_length(self): from mutagen.mp3 import MP3 total = 0 - for media in self.get_mp3(): + for media in self.get_mp3() or (): audio = MP3(media.file.path) total += audio.info.length return int(total)