]> git.0d.be Git - django-panik-emissions.git/commitdiff
create-sound-files: create parent directories if needed
authorFrédéric Péters <fpeters@0d.be>
Sat, 28 Dec 2019 13:02:16 +0000 (14:02 +0100)
committerFrédéric Péters <fpeters@0d.be>
Sat, 28 Dec 2019 13:02:16 +0000 (14:02 +0100)
emissions/management/commands/create-sound-files.py

index ac1548b298154ca9d39cd3194d1675fb6edca719..55f1fae46ef3c9a46920688abd3ae3f96836f4d5 100644 (file)
@@ -82,7 +82,7 @@ class Command(BaseCommand):
     def create(self, soundfile, format):
         file_path = soundfile.get_format_path(format)
         if not os.path.exists(os.path.dirname(file_path)):
     def create(self, soundfile, format):
         file_path = soundfile.get_format_path(format)
         if not os.path.exists(os.path.dirname(file_path)):
-            os.mkdir(os.path.dirname(file_path))
+            os.makedirs(os.path.dirname(file_path))
 
         if self.copy and os.path.splitext(soundfile.file.path)[-1].strip('.') == format:
             shutil.copy(soundfile.file.path, file_path)
 
         if self.copy and os.path.splitext(soundfile.file.path)[-1].strip('.') == format:
             shutil.copy(soundfile.file.path, file_path)