Skip to content

Commit

Permalink
Merge pull request #176 from JoshAddington/required-selectMultiple
Browse files Browse the repository at this point in the history
remove 'required' attr from MultipleSelect widgets
  • Loading branch information
mlavin committed Dec 16, 2016
2 parents 45b0dc8 + ccfc7f5 commit 79376ce
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions selectable/forms/widgets.py
Expand Up @@ -218,6 +218,12 @@ def value_from_datadict(self, data, files, name):
value = self.get_compatible_postdata(data, name)
return value

def build_attrs(self, extra_attrs=None, **kwargs):
attrs = super(_BaseMultipleSelectWidget, self).build_attrs(extra_attrs, **kwargs)
if 'required' in attrs:
attrs.pop('required')
return attrs

def render(self, name, value, attrs=None):
if value and not hasattr(value, '__iter__'):
value = [value]
Expand Down

0 comments on commit 79376ce

Please sign in to comment.