Correct attrs handling

This commit is contained in:
Daniel Roy Greenfeld 2015-09-29 10:34:37 -07:00
parent 37258c47fb
commit 38d1126cbc

View file

@ -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'})