diff --git a/care/abdm/api/viewsets/auth.py b/care/abdm/api/viewsets/auth.py index b8765b726c..7b94a9b9b0 100644 --- a/care/abdm/api/viewsets/auth.py +++ b/care/abdm/api/viewsets/auth.py @@ -121,11 +121,14 @@ def post(self, request, *args, **kwargs): ) else: for identifier in verified_identifiers: + if identifier["value"] is None: + continue + if identifier["type"] == "MOBILE": matched_by.append(identifier["value"]) + mobile = identifier["value"].replace("+91", "").replace("-", "") patients = patients.filter( - Q(phone_number=f"+91{identifier['value']}") - | Q(phone_number=identifier["value"]) + Q(phone_number=f"+91{mobile}") | Q(phone_number=mobile) ) if identifier["type"] == "NDHM_HEALTH_NUMBER":