diff options
author | Javier Sánchez Parra <jsanchez@soleta.eu> | 2022-01-14 09:00:25 +0100 |
---|---|---|
committer | Javier Sánchez Parra <jsanchez@soleta.eu> | 2022-01-14 09:08:04 +0100 |
commit | 96d2797ec3dd4e37b668c58c43dce26ce24968d6 (patch) | |
tree | 013abca8980578962005269fac3ac7397b5376d3 /ogcp/views.py | |
parent | c34da1e09876f6b053ee50acf29538625a800d3a (diff) |
Fix "Add client" form redirectionv0.9
Otherwise, ogcp redirects to a blank page instead of the scopes view.
Diffstat (limited to 'ogcp/views.py')
-rw-r--r-- | ogcp/views.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/ogcp/views.py b/ogcp/views.py index 07a54ae..c309003 100644 --- a/ogcp/views.py +++ b/ogcp/views.py @@ -611,9 +611,12 @@ def action_client_add(): "serial_number": form.serial_number.data} r = g.server.post('/client/add', payload) - if r.status_code == requests.codes.ok: - return make_response("200 OK", 200) - return make_response("400 Bad Request", 400) + if r.status_code != requests.codes.ok: + flash(_('ogServer: error adding client'), + category='error') + else: + flash(_('Client added successfully'), category='info') + return redirect(url_for("scopes")) else: r = g.server.get('/mode') available_modes = [(mode, mode) for mode in r.json()['modes']] |