From ca00bd5e89a74579bcae34a88e464b469f79c8fa Mon Sep 17 00:00:00 2001 From: "Jose M. Guisado" Date: Wed, 23 Feb 2022 09:57:47 +0100 Subject: Redirect to commands view after hardware POST --- ogcp/views.py | 6 ++++-- 1 file 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) -- cgit v1.2.3-18-g5258