Skip to content

Commit

Permalink
fix: bug in MultiChoiceField validation
Browse files Browse the repository at this point in the history
  • Loading branch information
francesco-filicetti committed Feb 14, 2023
1 parent 21e75b9 commit ff2d5d8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion django_form_builder/dynamic_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,11 @@ def define_value(self, choices, **kwargs):
self.choices += _split_choices(splitted_string[0])

def clean(self, *args, **kwargs):
# args = args if isinstance(args[0], list) else ([args[0]],)
try:
args = args if isinstance(args[0], list) else ([args[0]],)
if args[0] == None: args = ([],)
except IndexError:
args = ([],)
return super().clean(*args, **kwargs)

def raise_error(self, name, cleaned_data, **kwargs):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

setup(
name='django-form-builder',
version='0.16.12',
version='0.16.13',
packages=find_packages(),
package_data={'': ['*.wav']},
data_files=[
Expand Down

0 comments on commit ff2d5d8

Please sign in to comment.