Skip to content

Commit

Permalink
fixed searching logic in discover
Browse files Browse the repository at this point in the history
  • Loading branch information
khavinshankar committed Jul 19, 2023
1 parent e0a1a59 commit 3605b8b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions care/abdm/api/viewsets/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down

0 comments on commit 3605b8b

Please sign in to comment.