From 38d1126cbcbd8c68c051f19b35cd9647381bd1a1 Mon Sep 17 00:00:00 2001 From: Daniel Roy Greenfeld Date: Tue, 29 Sep 2015 10:34:37 -0700 Subject: [PATCH] Correct attrs handling --- markdownx/widgets.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/markdownx/widgets.py b/markdownx/widgets.py index 907f953..872b2c4 100755 --- a/markdownx/widgets.py +++ b/markdownx/widgets.py @@ -9,7 +9,9 @@ from .settings import MARKDOWNX_EDITOR_RESIZABLE class MarkdownxWidget(forms.Textarea): def render(self, name, value, attrs=None): - if 'class' in attrs.keys(): + if attrs is None: + attrs = {} + elif 'class' in attrs: attrs['class'] += ' markdownx-editor' else: attrs.update({'class':'markdownx-editor'})