]> git.parisson.com Git - teleforma.git/commitdiff
fix cleanup
authorGuillaume Pellerin <yomguy@parisson.com>
Mon, 30 Dec 2013 15:18:49 +0000 (16:18 +0100)
committerGuillaume Pellerin <yomguy@parisson.com>
Mon, 30 Dec 2013 15:18:49 +0000 (16:18 +0100)
teleforma/management/commands/teleforma-import-seminar-media.py

index 20cb2cbdf7f0fd94bbc89b18b038e69234618fdf..f07b1fff473943e914412a372ca0331d30e2fdaa 100644 (file)
@@ -95,6 +95,8 @@ class Command(BaseCommand):
         seminars = []
 
         # self.cleanup()
+        for seminar in Seminar.objects.filter(period=period):
+            self.seminar_media_cleanup(seminar)
 
         walk = os.walk(self.media_dir, followlinks=True)
 
@@ -140,8 +142,6 @@ class Command(BaseCommand):
                         seminar.title = course.title
                         seminar.save()
 
-                    self.seminar_media_cleanup(seminar)
-
                     exist = False
                     medias = seminar.medias.all()
                     for media in medias: