print response
This commit is contained in:
@@ -40,7 +40,7 @@ class SendOTPView(APIView):
|
|||||||
user, created = User.objects.get_or_create(phone=phone)
|
user, created = User.objects.get_or_create(phone=phone)
|
||||||
otp = user.set_otp()
|
otp = user.set_otp()
|
||||||
message = f"""به فروشگاه هی ملز خوش اومدی!!❤️🤖
|
message = f"""به فروشگاه هی ملز خوش اومدی!!❤️🤖
|
||||||
کد یک بار مصرف شما : {otp}"""
|
کد یک بار مصرف شما : {otp}"""
|
||||||
sms_api = ghasedak_sms.Ghasedak(api_key="1227eaaddcba72bcb0169b37032cf16ae9ac6ed8b3b7c2768b74e2ee351d1b52gyRe3AGomZRPTNEd")
|
sms_api = ghasedak_sms.Ghasedak(api_key="1227eaaddcba72bcb0169b37032cf16ae9ac6ed8b3b7c2768b74e2ee351d1b52gyRe3AGomZRPTNEd")
|
||||||
|
|
||||||
# response = sms_api.send_single_sms(ghasedak_sms.SendSingleSmsInput(message=message, receptor=phone, line_number='30005006006908', send_date='', client_reference_id=''))
|
# response = sms_api.send_single_sms(ghasedak_sms.SendSingleSmsInput(message=message, receptor=phone, line_number='30005006006908', send_date='', client_reference_id=''))
|
||||||
@@ -62,6 +62,7 @@ class SendOTPView(APIView):
|
|||||||
if response['statusCode'] == 200:
|
if response['statusCode'] == 200:
|
||||||
return Response({'detail': 'OTP sent successfully'}, status=status.HTTP_200_OK)
|
return Response({'detail': 'OTP sent successfully'}, status=status.HTTP_200_OK)
|
||||||
else:
|
else:
|
||||||
|
print(response)
|
||||||
return Response({'detail': f'مشکلی در ارسال کد رخ داد'}, status=status.HTTP_200_OK)
|
return Response({'detail': f'مشکلی در ارسال کد رخ داد'}, status=status.HTTP_200_OK)
|
||||||
# return Response({'detail': response, 'otp_code': otp}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
|
# return Response({'detail': response, 'otp_code': otp}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user