Add a prefix for nopaque's data within the application context

This commit is contained in:
Patrick Jentsch 2023-04-04 08:56:19 +02:00
parent a27caaa8a2
commit 423709b4eb
2 changed files with 3 additions and 2 deletions

View File

@ -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, '.', '<i class="material-icons left">settings</i>Settings')
def settings():
g._nopaque_redirect_location_on_post = url_for('.settings')
return settings_route(current_user.id)

View File

@ -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)
)