|
@@ -3,7 +3,9 @@ from django.contrib.auth.backends import ModelBackend
|
|
|
|
|
|
|
|
|
class EmailBackend(ModelBackend):
|
|
|
- def authenticate(self, username, password=None, **kwargs):
|
|
|
+ def authenticate(self, request, username=None, password=None, **kwargs):
|
|
|
+ if not username:
|
|
|
+ return None
|
|
|
UserModel = get_user_model()
|
|
|
try:
|
|
|
user = UserModel._default_manager.get(email__iexact=username)
|