From 7f28808f66518292739df541b81bddf4618ea3bd Mon Sep 17 00:00:00 2001 From: Guillim Date: Fri, 21 Jun 2019 12:28:29 +0200 Subject: [PATCH] We try another way to specify the backend to the login function. Even though the original code mentions it is possible : https://docs.djangoproject.com/en/2.2/_modules/django/contrib/auth/#login --- app/authentification/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/authentification/utils.py b/app/authentification/utils.py index deba90f4..f6d10d40 100644 --- a/app/authentification/utils.py +++ b/app/authentification/utils.py @@ -16,8 +16,8 @@ def activate(request, uidb64, token): if user is not None and account_activation_token.check_token(user, token): user.is_active = True user.save() - login(request=request, user=user, - backend='django.contrib.auth.backends.ModelBackend') + user.backend = 'django.contrib.auth.backends.ModelBackend' + login(request=request, user=user,) return redirect('projects') else: return render(request, 'validate_mail_address_invalid.html')