fix
authorRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Tue, 14 Jun 2011 14:17:40 +0000 (16:17 +0200)
committerRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Tue, 14 Jun 2011 14:17:40 +0000 (16:17 +0200)
apps/archive/forms.py

index 5326261..922bd28 100755 (executable)
@@ -23,10 +23,10 @@ class AudiobookForm(forms.ModelForm):
             if not os.path.isdir(FILES_PATH):
                 os.makedirs(FILES_PATH)
             # save the file in model
             if not os.path.isdir(FILES_PATH):
                 os.makedirs(FILES_PATH)
             # save the file in model
-            bn = os.path.basename(path)
-            ef = ExistingFile(path)
-            
-            m.source_file.save(bn, ef)
+
+            m.source_file.save(
+                os.path.join(FILES_PATH, os.path.basename(path)),
+                ExistingFile(path))
 
         if commit:
             m.save()
 
         if commit:
             m.save()