From ed988f2b33845617a5f2de3c5530a97b9d24aea4 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Tue, 14 Jun 2011 15:52:35 +0200 Subject: [PATCH] fix --- apps/archive/forms.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/archive/forms.py b/apps/archive/forms.py index 772ec0a..5326261 100755 --- a/apps/archive/forms.py +++ b/apps/archive/forms.py @@ -23,7 +23,10 @@ class AudiobookForm(forms.ModelForm): if not os.path.isdir(FILES_PATH): os.makedirs(FILES_PATH) # save the file in model - m.source_file.save(os.path.basename(path), ExistingFile(path)) + bn = os.path.basename(path) + ef = ExistingFile(path) + + m.source_file.save(bn, ef) if commit: m.save() -- 2.20.1