fix(admin_login): redirect authenticated users away to prevent loop

This commit is contained in:
Luca 2024-09-16 02:52:35 +02:00
parent 46c6591170
commit 7dd8350cec
1 changed files with 3 additions and 0 deletions

View File

@ -14,6 +14,9 @@ def unauthorized(request):
def admin_login(request): def admin_login(request):
if request.user.is_authenticated:
return redirect("unauthorized")
query = "" query = ""
if next := request.GET.get("next"): if next := request.GET.get("next"):
q = QueryDict(mutable=True) q = QueryDict(mutable=True)