Follow the convention for error formatting
This commit is contained in:
parent
fb2852acdc
commit
f8ccb8aaaa
@ -488,13 +488,13 @@ def preview_markdown():
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
if not validate_csrf(request.headers.get('X-CSRFToken')):
|
if not validate_csrf(request.headers.get('X-CSRFToken')):
|
||||||
return jsonify({'status': 'fail',
|
return jsonify({'_status': 'ERR',
|
||||||
'error': 'CRSF validation failed'}), 403
|
'message': 'CSRF validation failed.'}), 403
|
||||||
try:
|
try:
|
||||||
content = request.form['content']
|
content = request.form['content']
|
||||||
except KeyError:
|
except KeyError:
|
||||||
return jsonify({'status': 'fail',
|
return jsonify({'_status': 'ERR',
|
||||||
'error': 'The field "content" was not specified.'}), 400
|
'message': 'The field "content" was not specified.'}), 400
|
||||||
return jsonify(content=markdown(content))
|
return jsonify(content=markdown(content))
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user