1
0
mirror of https://github.com/django/django.git synced 2025-10-24 22:26:08 +00:00

Fixed #25187 -- Made request available in authentication backends.

This commit is contained in:
Aleksej Manaev
2016-07-11 16:40:39 +02:00
committed by Tim Graham
parent 32c0d823e5
commit 4b9330ccc0
12 changed files with 106 additions and 24 deletions

View File

@@ -5,7 +5,7 @@ from .models import CustomUser
class CustomUserBackend(ModelBackend):
def authenticate(self, username=None, password=None):
def authenticate(self, request, username=None, password=None):
try:
user = CustomUser.custom_objects.get_by_natural_key(username)
if user.check_password(password):