Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def markdown_imgur_uploader(request):
"""
Makdown image upload for uploading to imgur.com
and represent as json to markdown editor.
"""
if request.method == 'POST' and request.is_ajax():
if 'markdown-image-upload' in request.FILES:
image = request.FILES['markdown-image-upload']
data = imgur_uploader(image)
return HttpResponse(data, content_type='application/json')
return HttpResponse(_('Invalid request!'))
return HttpResponse(_('Invalid request!'))