summaryrefslogtreecommitdiffstats
path: root/ogcp/views.py
diff options
context:
space:
mode:
authorJose M. Guisado <jguisado@soleta.eu>2022-02-23 09:57:47 +0100
committerJose M. Guisado <jguisado@soleta.eu>2022-02-23 09:58:10 +0100
commitca00bd5e89a74579bcae34a88e464b469f79c8fa (patch)
tree84a75803ea4fd4994aa119e08c0d2024c9430bd6 /ogcp/views.py
parenta32611993731e575b04b50c9d4f4fcd80bd28dc9 (diff)
Redirect to commands view after hardware POST
Diffstat (limited to 'ogcp/views.py')
-rw-r--r--ogcp/views.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/ogcp/views.py b/ogcp/views.py
index a5b04a1..c0d19ad 100644
--- a/ogcp/views.py
+++ b/ogcp/views.py
@@ -473,8 +473,10 @@ def action_hardware():
ips = form.ips.data.split(' ')
r = g.server.post('/hardware', payload={'clients': ips})
if r.status_code == requests.codes.ok:
- return make_response("200 OK", 200)
- return make_response("400 Bad Request", 400)
+ flash(_(f'Hardware inventory command has been sent'), category='info')
+ else:
+ flash(_(f'There was a problem sending the hardware inventory command'), category='error')
+ return redirect(url_for('commands'))
else:
ips = parse_elements(request.args.to_dict())
scopes, _clients = get_scopes(ips)