From 989dc5bd36959c785ffabab02eade3a0719e6093 Mon Sep 17 00:00:00 2001 From: "Jose M. Guisado" Date: Wed, 10 Feb 2021 11:58:46 +0000 Subject: 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. --- ogcp/templates/actions/image_create.html | 11 +++++++++++ ogcp/views.py | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 ogcp/templates/actions/image_create.html diff --git a/ogcp/templates/actions/image_create.html b/ogcp/templates/actions/image_create.html new file mode 100644 index 0000000..2e2b4f9 --- /dev/null +++ b/ogcp/templates/actions/image_create.html @@ -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 %} diff --git a/ogcp/views.py b/ogcp/views.py index e2ecaf4..14db2dd 100644 --- a/ogcp/views.py +++ b/ogcp/views.py @@ -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()) -- cgit v1.2.3-18-g5258