feat: added user info form

This commit is contained in:
Pablo Moreno
2025-01-18 13:55:33 +01:00
parent 3995fa9c5a
commit 249521aa4a
10 changed files with 186 additions and 53 deletions
+7 -1
View File
@@ -1,3 +1,5 @@
import urllib
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth import login as login_user
@@ -6,7 +8,7 @@ from django.contrib.auth.tokens import default_token_generator
from django.core.exceptions import ValidationError
from django.db import IntegrityError
from django.shortcuts import redirect, render, reverse
from django.utils.http import url_has_allowed_host_and_scheme, urlsafe_base64_decode
from django.utils.http import url_has_allowed_host_and_scheme, urlsafe_base64_decode, urlencode
from django.utils.text import gettext_lazy as _
from django.views.generic import TemplateView, View
@@ -29,6 +31,10 @@ class LoginView(View, RedirectionMixin):
redirect_to = "web:index"
login_form_class = LoginForm
def get_redirection(self):
query_param_string = urlencode(self.request.GET)
return f'{reverse(self.redirect_to)}?{query_param_string.join("")}'
def get_login_form(self, request):
return self.login_form_class(data=request.POST)