🔧 chore(apps): update app names and structures in various files

This commit is contained in:
sankalp committed 2025-06-15 22:45:09 +05:45
1 parent e7a78acfe4
commit b198b18538
27 files changed
+588 -45

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
from django.contrib.auth import get_user_model
from django.contrib.auth.backends import ModelBackend
from django.db.models import Q
UserModel = get_user_model()
class EmailOrPhoneBackend(ModelBackend):
def authenticate(self, request, username=None, password=None, **kwargs):
try:
user = UserModel.objects.get(Q(email=username) | Q(phone=username))
except UserModel.DoesNotExist:
return None
if user.check_password(password) and self.user_can_authenticate(user):
return user
return None