Add image create template

Image creation action was lacking a template to render the form. This
patch adds said template.

Also redirects to /scopes when the request was processed by the ogserver
successfully.
multi-ogserver
Jose M. Guisado 2021-02-10 11:58:46 +00:00
parent 3eda3fa684
commit 989dc5bd36
2 changed files with 12 additions and 1 deletions

View File

@ -0,0 +1,11 @@
{% extends 'base.html' %}
{% import "bootstrap/wtf.html" as wtf %}
{% block content %}
{{ wtf.quick_form(form,
action=url_for('action_image_create'),
method='post',
button_map={'create': 'primary'}) }}
{% endblock %}

View File

@ -443,7 +443,7 @@ def action_image_create():
"center_id": r.json()["center"]}
r = g.server.post('/image/create', payload)
if r.status_code == requests.codes.ok:
return make_response("200 OK", 200)
return redirect(url_for("scopes"))
return make_response("400 Bad Request", 400)
else:
ips = parse_ips(request.args.to_dict())