remove more email related code
Build and Push Docker Images / Build and Push Docker Images (push) Failing after 8s

This commit is contained in:
2026-08-02 14:32:10 +05:00
parent 00d25698c6
commit 1f5e60dbb4
3 changed files with 6 additions and 19 deletions
-17
View File
@@ -1,17 +0,0 @@
from django.contrib.auth import get_user_model
from django.contrib.auth.backends import ModelBackend
class EmailBackend(ModelBackend):
def authenticate(self, request, username=None, password=None, **kwargs):
UserModel = get_user_model()
if not password:
return None
try:
user = UserModel.objects.get(email=username)
except UserModel.DoesNotExist:
return None
else:
if user.check_password(password):
return user
return None
+4
View File
@@ -75,6 +75,10 @@ class User(AbstractUser):
objects = CustomUserManager()
# Log in with username + password only; email is optional and not prompted
# by createsuperuser.
REQUIRED_FIELDS = []
class TemporaryUser(models.Model):
t_id = models.AutoField(primary_key=True)
+2 -2
View File
@@ -157,9 +157,9 @@ DATABASES = {
# Password validation
# https://docs.djangoproject.com/en/5.0/ref/settings/#auth-password-validators
# Uses email as username for login
# Log in with username + password (default Django backend)
AUTH_USER_MODEL = "api.User"
AUTHENTICATION_BACKENDS = ["api.backends.EmailBackend"]
AUTHENTICATION_BACKENDS = ["django.contrib.auth.backends.ModelBackend"]
AUTH_PASSWORD_VALIDATORS = [
{