]> git.parisson.com Git - teleforma.git/commitdiff
delete all new seminar medias
authorGuillaume Pellerin <yomguy@parisson.com>
Mon, 30 Dec 2013 13:55:32 +0000 (14:55 +0100)
committerGuillaume Pellerin <yomguy@parisson.com>
Mon, 30 Dec 2013 13:55:32 +0000 (14:55 +0100)
teleforma/management/commands/teleforma-import-seminar-media.py

index 38c41c3fd9649f71637cc3f4e8cbca0a60f0c266..d367915cd3a860b09d6d1c388a178b4ab58235b1 100644 (file)
@@ -69,7 +69,8 @@ class Command(BaseCommand):
     def seminar_media_cleanup(self, seminar):
         for media in seminar.medias.all():
             self.delete_media(media)
-        self.delete_media(seminar.media_preview)
+        if seminar.media_preview:
+            self.delete_media(seminar.media_preview)
 
     def get_duration(self, file):
         decoder = timeside.decoder.FileDecoder(file)