From aa5b52db2f831243b774df8b029322a3dd986822 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Mon, 10 Oct 2022 01:36:28 +0200 Subject: [PATCH] FIX: Still redirect to /register by default if no users have been created --- platypush/backend/http/app/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platypush/backend/http/app/utils.py b/platypush/backend/http/app/utils.py index 99eda6a81..ad7bb61b3 100644 --- a/platypush/backend/http/app/utils.py +++ b/platypush/backend/http/app/utils.py @@ -213,7 +213,8 @@ def authenticate( 412, ) - return redirect('/login?redirect=' + (redirect_page or request.url), 307) + target_page = 'login' if has_users else 'register' + return redirect(f'/{target_page}?redirect={redirect_page or request.url}', 307) def decorator(f): @wraps(f)