Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django 3 compatibility #19

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions suit_redactor/widgets.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# from django.core.serializers import json
from django.forms import Textarea
from django.utils.safestring import mark_safe
from django.contrib.staticfiles.templatetags.staticfiles import static
from django.templatetags.static import static

try:
import json
Expand All @@ -23,8 +23,8 @@ def __init__(self, attrs=None, editor_options={}):
super(RedactorWidget, self).__init__(attrs)
self.editor_options = editor_options

def render(self, name, value, attrs=None):
output = super(RedactorWidget, self).render(name, value, attrs)
def render(self, name, value, attrs=None, renderer=None):
output = super(RedactorWidget, self).render(name, value, attrs, renderer=renderer)
output += mark_safe(
'<script type="text/javascript">$("#id_%s").redactor(%s);</script>'
% (name, json.dumps(self.editor_options)))
Expand Down