From f8ccb8aaaa60649e39467c5197ef95c28d2d87ee Mon Sep 17 00:00:00 2001 From: Francesco Siddi Date: Wed, 21 Mar 2018 20:17:24 +0100 Subject: [PATCH] Follow the convention for error formatting --- pillar/web/nodes/routes.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pillar/web/nodes/routes.py b/pillar/web/nodes/routes.py index d0116edc..105ca1dd 100644 --- a/pillar/web/nodes/routes.py +++ b/pillar/web/nodes/routes.py @@ -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))