diff --git a/api/base/authentication/backends.py b/api/base/authentication/backends.py index 1f6adedbb338..b2766b094a76 100644 --- a/api/base/authentication/backends.py +++ b/api/base/authentication/backends.py @@ -2,11 +2,12 @@ from framework.auth.core import get_user from django.contrib.auth.backends import ModelBackend -# https://docs.djangoproject.com/en/1.8/topics/auth/customizing/ + +# https://docs.djangoproject.com/en/3.2/topics/auth/customizing/ class ODMBackend(ModelBackend): - def authenticate(self, request, username=None, password=None, email=None): - return get_user(email=email or username, password=password) or None + def authenticate(self, request, username=None, password=None, **kwargs): + return get_user(email=username, password=password) or None def get_user(self, user_id): try: