Skip to content

Commit

Permalink
Merge branch 'feature/django_upgrade' into django-3-onmibus
Browse files Browse the repository at this point in the history
  • Loading branch information
Johnetordoff committed Sep 19, 2022
2 parents 7b581ee + 93081d4 commit 014911f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions api/base/authentication/backends.py
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 014911f

Please sign in to comment.