From 9f201a45c66cf4935d183adba6d3b616e09a81c8 Mon Sep 17 00:00:00 2001 From: codeEmpress1 Date: Thu, 28 Sep 2023 18:50:48 +0300 Subject: [PATCH] update charmhub beta (#1670) * update charmhub beta * fix failing test * update dependencies * update store-base version * update store-base --- webapp/decorators.py | 2 ++ webapp_beta/beta_app.py | 1 + 2 files changed, 3 insertions(+) diff --git a/webapp/decorators.py b/webapp/decorators.py index 0b55233e0..283763364 100644 --- a/webapp/decorators.py +++ b/webapp/decorators.py @@ -17,6 +17,8 @@ def login_required(func): @functools.wraps(func) def is_user_logged_in(*args, **kwargs): if not authentication.is_authenticated(flask.session): + if "beta" in flask.request.url: + return flask.redirect("/login?next=/beta" + flask.request.path) return flask.redirect("/login?next=" + flask.request.path) return func(*args, **kwargs) diff --git a/webapp_beta/beta_app.py b/webapp_beta/beta_app.py index 21f4edce7..ca8b54ed1 100644 --- a/webapp_beta/beta_app.py +++ b/webapp_beta/beta_app.py @@ -7,6 +7,7 @@ from canonicalwebteam.candid import CandidClient from webapp_beta.charmhub_bp import charmhub_bp +from webapp.decorators import login_required from webapp.handlers import charmhub_utility_processor from webapp.decorators import login_required