From 752972cd454945b5efc84a818bbabae9b7637bd2 Mon Sep 17 00:00:00 2001 From: behruz-dev Date: Wed, 8 Oct 2025 18:55:23 +0500 Subject: [PATCH] fix --- core/apps/accounts/serializers/auth.py | 2 +- core/services/sms_via_bot.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/apps/accounts/serializers/auth.py b/core/apps/accounts/serializers/auth.py index e4e5d92..55928f0 100644 --- a/core/apps/accounts/serializers/auth.py +++ b/core/apps/accounts/serializers/auth.py @@ -51,7 +51,7 @@ class ConfirmUserSerializer(serializers.Serializer): phone = data['phone'] code = data['code'] confirmation = VerificationCode.objects.filter(code=code, phone=phone).first() - if confirmation.is_verify: + if confirmation and confirmation.is_verify: raise serializers.ValidationError("Code is verified") if confirmation.is_expired or confirmation.expiration_time < timezone.now().time(): raise serializers.ValidationError("Code is expired") diff --git a/core/services/sms_via_bot.py b/core/services/sms_via_bot.py index e683d3e..259f5c4 100644 --- a/core/services/sms_via_bot.py +++ b/core/services/sms_via_bot.py @@ -5,7 +5,7 @@ from config.env import env def send_sms_code(code, type, phone): url = f'https://api.telegram.org/bot{env.str('BOT_TOKEN')}/sendMessage' payload = { - 'chat_id': '-4982277828', + 'chat_id': '-1003156599780', 'text': f'Sizning tasdiqlash kodingiz: {code}, \n Type: {type} \n Telefon raqam: {phone}', 'parse_mode': 'HTML', }