Commits

Mark Lavin committed 2941673

Fix error when passing widget instance to AutoCompleteSelectField or AutoCompleteSelectMultipleField.

  • Participants
  • Parent commits dac22d8
  • Branches stable

Comments (0)

Files changed (1)

File selectable/forms/fields.py

         self.lookup_class = lookup_class
         self.allow_new = kwargs.pop('allow_new', False)
         self.limit = kwargs.pop('limit', None)
-        widget = kwargs.pop('widget', self.widget) or self.widget
+        widget = kwargs.get('widget', self.widget) or self.widget
         if isinstance(widget, type):
             kwargs['widget'] = widget(lookup_class, allow_new=self.allow_new, limit=self.limit)
         super(AutoCompleteSelectField, self).__init__(*args, **kwargs)
     def __init__(self, lookup_class, *args, **kwargs):
         self.lookup_class = lookup_class
         self.limit = kwargs.pop('limit', None)
-        widget = kwargs.pop('widget', self.widget) or self.widget
+        widget = kwargs.get('widget', self.widget) or self.widget
         if isinstance(widget, type):
             kwargs['widget'] = widget(lookup_class, limit=self.limit)
         super(AutoCompleteSelectMultipleField, self).__init__(*args, **kwargs)