From 423709b4eb9d086010efb94a8e3a9b6cfc7be0e6 Mon Sep 17 00:00:00 2001
From: Patrick Jentsch
Date: Tue, 4 Apr 2023 08:56:19 +0200
Subject: [PATCH] Add a prefix for nopaque's data within the application
context
---
app/settings/routes.py | 3 ++-
app/users/settings/routes.py | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/app/settings/routes.py b/app/settings/routes.py
index 046f2f8c..837c0f6f 100644
--- a/app/settings/routes.py
+++ b/app/settings/routes.py
@@ -1,4 +1,4 @@
-from flask import url_for
+from flask import g, url_for
from flask_breadcrumbs import register_breadcrumb
from flask_login import current_user
from app.users.settings.routes import settings as settings_route
@@ -8,4 +8,5 @@ from . import bp
@bp.route('/settings', methods=['GET', 'POST'])
@register_breadcrumb(bp, '.', 'settingsSettings')
def settings():
+ g._nopaque_redirect_location_on_post = url_for('.settings')
return settings_route(current_user.id)
diff --git a/app/users/settings/routes.py b/app/users/settings/routes.py
index 13f222b7..d921c5c4 100644
--- a/app/users/settings/routes.py
+++ b/app/users/settings/routes.py
@@ -23,7 +23,7 @@ def settings(user_id):
abort(403)
redirect_location_on_post = g.pop(
- 'redirect_location_on_post',
+ '_nopaque_redirect_location_on_post',
url_for('.settings', user_id=user_id)
)