mirror of
https://github.com/evennia/evennia.git
synced 2026-03-28 02:36:32 +01:00
Fixed an issue with the backend authentication not getting the proper user model.
This commit is contained in:
parent
da097a88d9
commit
083642b2dd
1 changed files with 2 additions and 1 deletions
|
|
@ -1,5 +1,5 @@
|
|||
from django.contrib.auth.backends import ModelBackend
|
||||
from django.contrib.auth.models import User
|
||||
from django.contrib.auth import get_user_model
|
||||
|
||||
class CaseInsensitiveModelBackend(ModelBackend):
|
||||
"""
|
||||
|
|
@ -7,6 +7,7 @@ class CaseInsensitiveModelBackend(ModelBackend):
|
|||
generally expected. This backend supports case insensitive username authentication.
|
||||
"""
|
||||
def authenticate(self, username=None, password=None):
|
||||
User = get_user_model()
|
||||
try:
|
||||
user = User.objects.get(username__iexact=username)
|
||||
if user.check_password(password):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue