Browse Source

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

pull/250/head
Guillim 5 years ago
parent
commit
7f28808f66
1 changed files with 2 additions and 2 deletions
  1. 4
      app/authentification/utils.py

4
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')
Loading…
Cancel
Save