diff --git a/frontend/views.py b/frontend/views.py index e24a544..627bab1 100644 --- a/frontend/views.py +++ b/frontend/views.py @@ -129,10 +129,10 @@ class UpdateProjectView(ProtectedFormView, SingleObjectMixin): """ This form_valid handles the file upload. """ original_file = form.files[u'file'] original_filename = str(original_file) - + original_contentfile = ContentFile(original_file.read()) """ Put file into temporary folder for analysis """ target_filename = 'tmp/project_' + str(self.project_id) + '.ctt4' - relative_path = default_storage.save(target_filename, ContentFile(original_file.read())) + relative_path = default_storage.save(target_filename, original_contentfile) temp_sqlite = os.path.join(settings.MEDIA_ROOT, relative_path) """ Test if SQLite is a valid citavi project. """ @@ -153,7 +153,7 @@ class UpdateProjectView(ProtectedFormView, SingleObjectMixin): default_storage.delete(target_filename) """ Actually store file in citavi folder """ - relative_path = default_storage.save(target_filename, ContentFile(original_file.read())) + relative_path = default_storage.save(target_filename, original_contentfile) sqlite_path = os.path.join(settings.MEDIA_ROOT, relative_path) """ Store new original filename in Project """