prepare 0.9.4; minor fixes

This commit is contained in:
Artur Barseghyan 2016-10-25 00:53:52 +02:00
parent 2a6168084a
commit 26b3ad6255
8 changed files with 35 additions and 7 deletions

View file

@ -15,6 +15,14 @@ are used for versioning (schema follows below):
0.3.4 to 0.4).
- All backwards incompatible changes are mentioned in this document.
0.9.4
-----
2016-10-24
- Fix issue with `select_multiple`, `select_multiple_model_objects` and
`select_multiple_mptt_model_objects` being invalidated on the last step
of the form wizard.
0.9.3
-----
2016-10-24

View file

@ -204,7 +204,7 @@ for locale_dir in locale_dirs:
for f
in os.listdir(locale_dir)]
version = '0.9.3'
version = '0.9.4'
install_requires = []
# If certain version of Django is already installed, choose version agnostic

View file

@ -1,6 +1,6 @@
__title__ = 'django-fobi'
__version__ = '0.9.3'
__build__ = 0x000065
__version__ = '0.9.4'
__build__ = 0x000066
__author__ = 'Artur Barseghyan <artur.barseghyan@gmail.com>'
__copyright__ = '2014-2016 Artur Barseghyan'
__license__ = 'GPL 2.0/LGPL 2.1'

View file

@ -86,7 +86,8 @@ class SelectMultipleInputPlugin(FormFieldPlugin):
# Overwrite ``cleaned_data`` of the ``form`` with object
# qualifier.
form.cleaned_data[self.data.name] = ret_values
if ret_values:
form.cleaned_data[self.data.name] = ret_values
# It's critically important to return the ``form`` with updated
# ``cleaned_data``

View file

@ -104,7 +104,10 @@ class SelectMultipleModelObjectsInputPlugin(FormFieldPlugin):
values.append(value)
# Overwrite ``cleaned_data`` of the ``form`` with object qualifier.
form.cleaned_data[self.data.name] = json.dumps(values)
if values:
form.cleaned_data[self.data.name] = json.dumps(values)
else:
del form.cleaned_data[self.data.name]
# It's critically important to return the ``form`` with updated
# ``cleaned_data``

View file

@ -104,7 +104,10 @@ class SelectMultipleMPTTModelObjectsInputPlugin(FormFieldPlugin):
values.append(value)
# Overwrite ``cleaned_data`` of the ``form`` with object qualifier.
form.cleaned_data[self.data.name] = json.dumps(values)
if values:
form.cleaned_data[self.data.name] = json.dumps(values)
else:
del form.cleaned_data[self.data.name]
# It's critically important to return the ``form`` with updated
# ``cleaned_data``

View file

@ -1,7 +1,9 @@
=============================================================================
fobi.contrib.themes.bootstrap3.widgets.form_elements.slider_bootstrap3_widget
=============================================================================
A fancy slider widget to the ``slider`` plugin (for Bootstrap 3 theme).
A fancy slider widget to the ``slider`` plugin (for Bootstrap 3 theme). Based
on `bootstrap-slider.js <http://seiyria.com/bootstrap-slider/>`_. See the
`github <https://github.com/seiyria/bootstrap-slider>`_ for more.
Installation
============

View file

@ -8,6 +8,8 @@ import simplejson as json
from collections import OrderedDict
from six import string_types
from django.db import models, IntegrityError
from django.contrib import messages
from django.contrib.auth.decorators import login_required, permission_required
@ -1523,6 +1525,15 @@ class FormWizardView(DynamicSessionWizardView):
and form.data[wizard_form_key]):
form.data[wizard_form_key] = field_value
# This is dirty hack to make wizard validate empty multiple
# choice fields. Otherwise it would fail with message
# Select a valid choice. [] is not one of the available
# choices.
if wizard_form_key in form.data:
if not form.data[wizard_form_key]:
if isinstance(form.data[wizard_form_key], list):
del form.data[wizard_form_key]
# if the form is valid, store the cleaned data and files.
self.storage.set_step_data(self.steps.current,
self.process_step(form))