v1.0.55: POST redirect for clear + stray Enter (fix F5 resubmit warning)
This commit is contained in:
+1
-1
@@ -6,7 +6,7 @@ from routes.main import bp as main_bp
|
|||||||
from routes.api import bp as api_bp
|
from routes.api import bp as api_bp
|
||||||
from routes.api_test import bp as api_test_bp
|
from routes.api_test import bp as api_test_bp
|
||||||
|
|
||||||
VERSION = "1.0.54"
|
VERSION = "1.0.55"
|
||||||
|
|
||||||
app = Flask(__name__, template_folder="templates", static_folder="static")
|
app = Flask(__name__, template_folder="templates", static_folder="static")
|
||||||
app.config["NUBES_API_ENDPOINT"] = os.getenv("NUBES_API_ENDPOINT", "https://lk-api-gateway-dev.ngcloud.ru/api/v1/svc")
|
app.config["NUBES_API_ENDPOINT"] = os.getenv("NUBES_API_ENDPOINT", "https://lk-api-gateway-dev.ngcloud.ru/api/v1/svc")
|
||||||
|
|||||||
+4
-2
@@ -1,4 +1,4 @@
|
|||||||
from flask import Blueprint, current_app, render_template, request, make_response, jsonify
|
from flask import Blueprint, current_app, render_template, request, make_response, jsonify, redirect
|
||||||
|
|
||||||
from api.http_client import HttpClient, detect_endpoint
|
from api.http_client import HttpClient, detect_endpoint
|
||||||
from operations.get_instances import get_organization, get_instances
|
from operations.get_instances import get_organization, get_instances
|
||||||
@@ -76,7 +76,7 @@ def index():
|
|||||||
return render_template("index.html", **ctx)
|
return render_template("index.html", **ctx)
|
||||||
|
|
||||||
if action == "clear":
|
if action == "clear":
|
||||||
resp = make_response(_tmpl(organization=None, error=None, has_user_token=False))
|
resp = make_response(redirect("/"))
|
||||||
resp.delete_cookie("token")
|
resp.delete_cookie("token")
|
||||||
return resp
|
return resp
|
||||||
|
|
||||||
@@ -121,6 +121,8 @@ def index():
|
|||||||
else:
|
else:
|
||||||
error = "Токен невалиден или просрочен"
|
error = "Токен невалиден или просрочен"
|
||||||
|
|
||||||
|
if request.method == "POST":
|
||||||
|
return redirect("/")
|
||||||
return _tmpl()
|
return _tmpl()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user