Skip to content

Commit 7f28808

Browse files
author
Guillim
committed
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
1 parent 57f8097 commit 7f28808

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/authentification/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ def activate(request, uidb64, token):
1616
if user is not None and account_activation_token.check_token(user, token):
1717
user.is_active = True
1818
user.save()
19-
login(request=request, user=user,
20-
backend='django.contrib.auth.backends.ModelBackend')
19+
user.backend = 'django.contrib.auth.backends.ModelBackend'
20+
login(request=request, user=user,)
2121
return redirect('projects')
2222
else:
2323
return render(request, 'validate_mail_address_invalid.html')

0 commit comments

Comments
 (0)