Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #27 from dwink/master

spell_check view fails CSRF check
  • Loading branch information...
commit 9f0f3ffe5f6fa329b6325a9d26e85ccc0e5476d7 2 parents a7029a0 + aca57f5
@aljosa aljosa authored
Showing with 8 additions and 1 deletion.
  1. +8 −1 tinymce/views.py
View
9 tinymce/views.py
@@ -10,6 +10,10 @@
from django.utils.translation import ugettext as _
from tinymce.compressor import gzip_compressor
from tinymce.widgets import get_language_config
+try:
+ from django.views.decorators.csrf import csrf_exempt
+except ImportError:
+ pass
def textareas_js(request, name, lang=None):
"""
@@ -31,7 +35,6 @@ def textareas_js(request, name, lang=None):
return HttpResponse(template.render(context),
content_type="application/x-javascript")
-
def spell_check(request):
"""
Returns a HttpResponse that implements the TinyMCE spellchecker protocol.
@@ -69,6 +72,10 @@ def spell_check(request):
return HttpResponse(simplejson.dumps(output),
content_type='application/json')
+try:
+ spell_check = csrf_exempt(spell_check)
+except NameError:
+ pass
def preview(request, name):
"""
Please sign in to comment.
Something went wrong with that request. Please try again.