From f3e0ff7f68bffb5326955da802870abae944f658 Mon Sep 17 00:00:00 2001 From: Mikhail Podgurskiy Date: Sun, 13 Mar 2016 22:21:40 +0600 Subject: [PATCH] Special case for class attribute --- material/templatetags/material_form.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/material/templatetags/material_form.py b/material/templatetags/material_form.py index ca8ad325..89446946 100644 --- a/material/templatetags/material_form.py +++ b/material/templatetags/material_form.py @@ -234,7 +234,11 @@ def render(self, context): widget_attrs = self.widget_attrs.resolve(context) result = build_in_attrs.copy() + + if 'class' in result and 'class' in widget_attrs: + result['class'] += ' ' + widget_attrs.pop('class') result.update(widget_attrs) + for attr, (value, action) in override.items(): if action == 'override': result[attr] = value