add new api

This commit is contained in:
behruz-dev
2025-10-29 13:37:48 +05:00
parent 7097261131
commit 311a5311bd
7 changed files with 142 additions and 23 deletions

View File

@@ -11,11 +11,11 @@ from core.services.sms import send_sms_eskiz
from core.services.sms_via_bot import send_sms_code
@shared_task
def create_and_send_sms_code(phone):
def create_and_send_sms_code(phone, type):
verification = VerificationCode.objects.create(
code=''.join([str(random.randint(1, 100) % 10) for _ in range(4)]),
phone=phone,
expiration_time=timezone.now() + timedelta(minutes=2)
)
# send_sms_eskiz(user.phone, code)
send_sms_code(verification.code, 'auth', verification.phone)
send_sms_code(verification.code, type, verification.phone)