Skip to content

Commit

Permalink
Fix admin login failure for django upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
John Tordoff authored and cslzchen committed Sep 16, 2022
1 parent dd377cc commit 93081d4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions api/base/authentication/backends.py
Expand Up @@ -2,10 +2,11 @@
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, username=None, password=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):
Expand Down

0 comments on commit 93081d4

Please sign in to comment.