summaryrefslogtreecommitdiffstats
path: root/ogcp
diff options
context:
space:
mode:
authorJose M. Guisado <jguisado@soleta.eu>2022-02-23 10:01:53 +0100
committerJose M. Guisado <jguisado@soleta.eu>2022-02-23 10:01:53 +0100
commit5de191964aa8044863c48309fac60705c55fcdde (patch)
treecac59c014c25f6b2951a59a4e6b12ed414101e2f /ogcp
parentc5cb75eea341805c6b5d2109b86138ff2c7bd00f (diff)
Show error message for invalid setup form
Do not show plain text '400 Bad Request'. Instead, show error message and return to commands view.
Diffstat (limited to 'ogcp')
-rw-r--r--ogcp/views.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/ogcp/views.py b/ogcp/views.py
index c0d19ad..99e7fa1 100644
--- a/ogcp/views.py
+++ b/ogcp/views.py
@@ -390,7 +390,8 @@ def action_setup_modify():
r = g.server.post('/setup', payload=payload)
if r.status_code == requests.codes.ok:
return redirect(url_for('commands'))
- return make_response("400 Bad Request", 400)
+ flash(_(f'Invalid setup form'), category='error')
+ return redirect(url_for('commands'))
@app.route('/action/image/restore', methods=['GET', 'POST'])
@login_required