Skip to content

Commit

Permalink
Merge branch 'feature/django_upgrade' of https://github.com/CenterFor…
Browse files Browse the repository at this point in the history
…OpenScience/osf.io into django-3-onmibus

* 'feature/django_upgrade' of https://github.com/CenterForOpenScience/osf.io:
  Fix admin login failure for django upgrade

# Conflicts:
#	api/base/authentication/backends.py
  • Loading branch information
John Tordoff committed Sep 19, 2022
2 parents b58c17f + 93081d4 commit 5a24b8f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions api/base/authentication/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 5a24b8f

Please sign in to comment.