mirror of
https://github.com/Hopiu/django-fobi.git
synced 2026-05-12 22:53:12 +00:00
prepare 0.4.31; When path of the uploaded file (plugins) doesn't yet exist, create it,
This commit is contained in:
parent
bb4968bcd7
commit
77c21c5bbb
5 changed files with 18 additions and 5 deletions
|
|
@ -15,7 +15,7 @@ are used for versioning (schema follows below):
|
|||
0.3.4 to 0.4).
|
||||
- All backwards incompatible changes are mentioned in this document.
|
||||
|
||||
0.4.31
|
||||
0.4.32
|
||||
-------------------------------------
|
||||
yyyy-mm-ddd (not yet released).
|
||||
|
||||
|
|
@ -23,6 +23,13 @@ yyyy-mm-ddd (not yet released).
|
|||
`fobi.contrib.plugins.form_elements.fields.checkbox_select_multiple
|
||||
<https://github.com/barseghyanartur/django-fobi/tree/master/src/fobi/contrib/plugins/form_elements/fields/checkbox_select_multiple>`_.
|
||||
|
||||
0.4.31
|
||||
-------------------------------------
|
||||
2015-03-23
|
||||
|
||||
- When path of the uploaded file (plugins) doesn't yet exist, create it,
|
||||
instaid of failing.
|
||||
|
||||
0.4.30
|
||||
-------------------------------------
|
||||
2015-03-23
|
||||
|
|
|
|||
2
setup.py
2
setup.py
|
|
@ -63,7 +63,7 @@ for static_dir in static_dirs:
|
|||
for locale_dir in locale_dirs:
|
||||
locale_files += [os.path.join(locale_dir, f) for f in os.listdir(locale_dir)]
|
||||
|
||||
version = '0.4.30'
|
||||
version = '0.4.31'
|
||||
|
||||
install_requires = [
|
||||
'Pillow>=2.0.0',
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
__title__ = 'django-fobi'
|
||||
__version__ = '0.4.30'
|
||||
__build__ = 0x000033
|
||||
__version__ = '0.4.31'
|
||||
__build__ = 0x000034
|
||||
__author__ = 'Artur Barseghyan <artur.barseghyan@gmail.com>'
|
||||
__copyright__ = '2014-2015 Artur Barseghyan'
|
||||
__license__ = 'GPL 2.0/LGPL 2.1'
|
||||
|
|
|
|||
|
|
@ -15,7 +15,9 @@ from fobi.base import FormFieldPlugin, form_element_plugin_registry
|
|||
from fobi.helpers import handle_uploaded_file
|
||||
from fobi.contrib.plugins.form_elements.fields.file import UID
|
||||
from fobi.contrib.plugins.form_elements.fields.file.forms import FileInputForm
|
||||
from fobi.contrib.plugins.form_elements.fields.file.settings import FILES_UPLOAD_DIR
|
||||
from fobi.contrib.plugins.form_elements.fields.file.settings import (
|
||||
FILES_UPLOAD_DIR
|
||||
)
|
||||
|
||||
class FileInputPlugin(FormFieldPlugin):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -177,6 +177,10 @@ def handle_uploaded_file(upload_dir, image_file):
|
|||
"""
|
||||
upload_dir_absolute_path = os.path.join(settings.MEDIA_ROOT, upload_dir)
|
||||
|
||||
# Create path if doesn't exist yet
|
||||
if not os.path.exists(upload_dir_absolute_path):
|
||||
os.makedirs(upload_dir_absolute_path)
|
||||
|
||||
if isinstance(image_file, File):
|
||||
destination_path = ensure_unique_filename(
|
||||
os.path.join(upload_dir_absolute_path, image_file.name)
|
||||
|
|
|
|||
Loading…
Reference in a new issue