Login Va Register bitta qilib yuborildi

This commit is contained in:
2025-12-03 13:14:44 +05:00
parent fcba840ce9
commit f340b56218
3 changed files with 7 additions and 7 deletions

View File

@@ -24,8 +24,13 @@ class UserService(sms.SmsService):
"phone": phone,
},
)
if user.is_superuser:
user.is_superuser = True
user.save()
return user
user.set_unusable_password()
user.save()
return user
def send_confirmation(self, phone) -> bool:
try:
@@ -40,6 +45,7 @@ class UserService(sms.SmsService):
"""
Create user if user not found
"""
if user.validated_at is None:
user.validated_at = datetime.now()
user.save()