Skip to content

Commit

Permalink
additional check for detecting multi-select fields. might fix stephen…
Browse files Browse the repository at this point in the history
  • Loading branch information
benzkji committed Aug 12, 2014
1 parent cb37d89 commit fc415d9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion forms_builder/forms/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,9 @@ def __init__(self, form, context, *args, **kwargs):
except KeyError:
initial_val = Template(field.default).render(context)
if initial_val:
if field.is_a(*fields.MULTIPLE):
if field.is_a(*fields.MULTIPLE) or issubclass(field_class,
(forms.MultipleChoiceField,
forms.ModelMultipleChoiceField)):
initial_val = split_choices(initial_val)
if field.field_type == fields.CHECKBOX:
initial_val = initial_val != "False"
Expand Down

0 comments on commit fc415d9

Please sign in to comment.