mirror of
https://github.com/Hopiu/django-markdownx.git
synced 2026-03-17 05:50:23 +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
|
||||
|
||||
data = str(data, encoding='UTF-8')
|
||||
print(data)
|
||||
# print(data)
|
||||
# ------------------------------------------------
|
||||
# Handles JavaScript nodes and stringified nodes.
|
||||
# ------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -45,11 +45,10 @@ class ImageUploadView(BaseFormView):
|
|||
and the default response for HTTP requests.
|
||||
:rtype: django.http.JsonResponse, django.http.HttpResponse
|
||||
"""
|
||||
response = super(ImageUploadView, self).form_invalid(form)
|
||||
|
||||
if self.request.is_ajax():
|
||||
return JsonResponse(form.errors, status=400)
|
||||
|
||||
response = super(ImageUploadView, self).form_invalid(form)
|
||||
return response
|
||||
|
||||
def form_valid(self, form):
|
||||
|
|
|
|||
Loading…
Reference in a new issue