diff --git a/tubearchivist/home/templates/home/login.html b/tubearchivist/home/templates/home/login.html index d7bfed5..5e2c23d 100644 --- a/tubearchivist/home/templates/home/login.html +++ b/tubearchivist/home/templates/home/login.html @@ -29,6 +29,7 @@ {% for field in form %} {{ field }}
{% endfor %} + diff --git a/tubearchivist/home/views.py b/tubearchivist/home/views.py index 0f568d5..1c16844 100644 --- a/tubearchivist/home/views.py +++ b/tubearchivist/home/views.py @@ -161,10 +161,13 @@ class LoginView(View): """handle login post request""" form = AuthenticationForm(data=request.POST) if form.is_valid(): + next_url = request.POST.get('next') or "home" + print(f"next url: {next_url}") user = form.get_user() login(request, user) + return redirect(next_url) - return redirect("/") + return redirect("login") @staticmethod def read_config():