move registration sms to view from signals and fix include User verified
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 4m2s

attribute 🐛
This commit is contained in:
2025-09-15 21:33:59 +05:00
parent 6ae56774d1
commit 4714b6ec15
3 changed files with 19 additions and 10 deletions

View File

@@ -183,17 +183,34 @@ class VerifyOTPView(generics.GenericAPIView):
acc_no=temp_user.t_acc_no,
id_card=temp_user.t_id_card,
dob=temp_user.t_dob,
verified=temp_user.t_verified,
atoll=temp_user.t_atoll,
island=temp_user.t_island,
terms_accepted=temp_user.t_terms_accepted,
policy_accepted=temp_user.t_policy_accepted,
)
if temp_user.t_verified:
send_sms(
t_user.t_mobile,
f"Dear {temp_user.t_first_name} {temp_user.t_last_name}, \n\nYour account has been successfully verified. \n\nYou can now manage your devices and make payments through our portal at https://portal.sarlink.net. \n\n - SAR Link",
)
else:
send_sms(
t_user.t_mobile,
f"Dear {t_user.t_first_name} {t_user.t_last_name}, \n\nYour account registration is being processed. \n\nWe will notify you once verification is complete. \n\n - SAR Link",
)
# You can now trigger registry verification as a signal or task
temp_user.otp_verified = True
temp_user.save()
return Response({"message": "User created successfully."})
return Response(
{
"message": "User created successfully.",
"verified": temp_user.t_verified
}
)
class LoginView(KnoxLoginView):