Skip to content

Commit

Permalink
Merge 84308dc into cd00c5d
Browse files Browse the repository at this point in the history
  • Loading branch information
sheeshmohsin committed Apr 12, 2017
2 parents cd00c5d + 84308dc commit 03a82b1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions searchableselect/widgets.py
Expand Up @@ -50,8 +50,12 @@ def render(self, name, value, attrs=None, choices=()):
self.many = False

values = get_model(self.model).objects.filter(pk__in=value)

final_attrs = self.build_attrs(attrs, name=name)
try:
final_attrs = self.build_attrs(attrs, name=name)
except TypeError as e:
# Fallback for django 1.10+
final_attrs = self.build_attrs(attrs, extra_attrs={'name': name})


return render_to_string('searchableselect/select.html', dict(
field_id=final_attrs['id'],
Expand Down

0 comments on commit 03a82b1

Please sign in to comment.