mirror of
https://github.com/Hopiu/django-markdownx.git
synced 2026-05-27 13:33:59 +00:00
Closes #143: Error when invalid image upload
This commit is contained in:
parent
8d0a2f1ffb
commit
ccd1961ba8
2 changed files with 2 additions and 3 deletions
|
|
@ -147,7 +147,7 @@ def xml_has_javascript(data):
|
||||||
from re import search, IGNORECASE, MULTILINE
|
from re import search, IGNORECASE, MULTILINE
|
||||||
|
|
||||||
data = str(data, encoding='UTF-8')
|
data = str(data, encoding='UTF-8')
|
||||||
print(data)
|
# print(data)
|
||||||
# ------------------------------------------------
|
# ------------------------------------------------
|
||||||
# Handles JavaScript nodes and stringified nodes.
|
# Handles JavaScript nodes and stringified nodes.
|
||||||
# ------------------------------------------------
|
# ------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -45,11 +45,10 @@ class ImageUploadView(BaseFormView):
|
||||||
and the default response for HTTP requests.
|
and the default response for HTTP requests.
|
||||||
:rtype: django.http.JsonResponse, django.http.HttpResponse
|
:rtype: django.http.JsonResponse, django.http.HttpResponse
|
||||||
"""
|
"""
|
||||||
response = super(ImageUploadView, self).form_invalid(form)
|
|
||||||
|
|
||||||
if self.request.is_ajax():
|
if self.request.is_ajax():
|
||||||
return JsonResponse(form.errors, status=400)
|
return JsonResponse(form.errors, status=400)
|
||||||
|
|
||||||
|
response = super(ImageUploadView, self).form_invalid(form)
|
||||||
return response
|
return response
|
||||||
|
|
||||||
def form_valid(self, form):
|
def form_valid(self, form):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue