mirror of
https://github.com/pretix/pretix.git
synced 2026-05-04 15:04:03 +00:00
Fixed #115 -- Incorrect usage of storage API
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import copy
|
||||
import logging
|
||||
import os
|
||||
|
||||
from django import forms
|
||||
from django.core.files import File
|
||||
@@ -66,6 +67,8 @@ class SettingsForm(forms.Form):
|
||||
)
|
||||
else:
|
||||
fname = '%s/%s.%s' % (self.obj.slug, name, value.name.split('.')[-1])
|
||||
if not os.path.exists(os.path.dirname(fname)):
|
||||
os.makedirs(os.path.dirname(fname))
|
||||
with default_storage.open(fname, 'wb+') as destination:
|
||||
for chunk in value.chunks():
|
||||
destination.write(chunk)
|
||||
|
||||
Reference in New Issue
Block a user