diff --git a/django_editorjs_fields/widgets.py b/django_editorjs_fields/widgets.py index fc510ff..42b85f9 100644 --- a/django_editorjs_fields/widgets.py +++ b/django_editorjs_fields/widgets.py @@ -13,7 +13,8 @@ def __init__(self, plugins=None, tools=None, config=None, **kwargs): self.tools = tools self.config = config - widget = kwargs.pop('widget', None) # Fix "__init__() got an unexpected keyword argument 'widget'" + # Fix "__init__() got an unexpected keyword argument 'widget'" + widget = kwargs.pop('widget', None) if widget: self.plugins = widget.plugins self.tools = widget.tools @@ -71,14 +72,14 @@ def render(self, name, value, attrs=None, renderer=None): html = super().render(name, value, attrs) html += ''' -
+ ''' % ( - attrs.get('id'), - json.dumps(self.configuration()), - ) + ''' % { + 'id': attrs.get('id'), + 'config': json.dumps(self.configuration()), + } return mark_safe(html)