From c9b0c702e2bca2ca72d77010586f2108008f9bb3 Mon Sep 17 00:00:00 2001 From: Aswanth Vc Date: Sun, 10 Nov 2024 01:42:25 +0530 Subject: [PATCH] fix(wadhwani): give error message if mobile number not provided. --- api/integrations/wadhwani/wadhwani_views.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/integrations/wadhwani/wadhwani_views.py b/api/integrations/wadhwani/wadhwani_views.py index 0ec6c2eb..70627777 100644 --- a/api/integrations/wadhwani/wadhwani_views.py +++ b/api/integrations/wadhwani/wadhwani_views.py @@ -33,6 +33,10 @@ def post(self, request): url = settings.WADHWANI_BASE_URL + "/api/v1/iamservice/oauth/login" user_id = JWTUtils.fetch_user_id(request) user = User.objects.get(id=user_id) + if not user.mobile: + return CustomResponse( + general_message="Please update your mobile number and try again." + ).get_failure_response() if not (token := request.data.get("Client-Auth-Token", None)): return CustomResponse( general_message="Token is required"