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 22, 2022
1 parent 137ae08 commit 4208a3f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions api/base/authentication/backends.py
Original file line number Diff line number Diff line change
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 4208a3f

Please sign in to comment.