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')):
|
||||
return jsonify({'status': 'fail',
|
||||
'error': 'CRSF validation failed'}), 403
|
||||
return jsonify({'_status': 'ERR',
|
||||
'message': 'CSRF validation failed.'}), 403
|
||||
try:
|
||||
content = request.form['content']
|
||||
except KeyError:
|
||||
return jsonify({'status': 'fail',
|
||||
'error': 'The field "content" was not specified.'}), 400
|
||||
return jsonify({'_status': 'ERR',
|
||||
'message': 'The field "content" was not specified.'}), 400
|
||||
return jsonify(content=markdown(content))
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user