From 1fb0639756b1eb565caf1013f667bf2e85a6c071 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Dlouh=C3=BD?= Date: Sat, 29 Jul 2017 20:37:16 +0200 Subject: [PATCH] fix getting css_class from self (needet to work with django-crispy-forms) --- smart_selects/widgets.py | 1 + 1 file changed, 1 insertion(+) diff --git a/smart_selects/widgets.py b/smart_selects/widgets.py index 0be4189..0265af5 100644 --- a/smart_selects/widgets.py +++ b/smart_selects/widgets.py @@ -133,6 +133,7 @@ def render(self, name, value, attrs=None, choices=()): # noqa: C901 final_choices.append(ch) self.choices = final_choices + attrs.update(self.attrs) attrs["data-chainfield"] = chained_field attrs["data-url"] = url attrs["data-value"] = "null" if value is None or value == "" else value