From 9d7991a553d0aa550c3fb28ad7875f7070ee0b0f Mon Sep 17 00:00:00 2001 From: Pawan Verma Date: Tue, 26 Nov 2024 13:27:19 +0530 Subject: [PATCH] Fix wrong text check causing issues in hq user creation --- commcare_connect/users/helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commcare_connect/users/helpers.py b/commcare_connect/users/helpers.py index 5cfbe50b..04264954 100644 --- a/commcare_connect/users/helpers.py +++ b/commcare_connect/users/helpers.py @@ -34,7 +34,7 @@ def create_hq_user(user, domain, api_key): try: hq_request.raise_for_status() except httpx.HTTPStatusError as e: - if e.response.status_code == 400 and "already exists" in e.response.text: + if e.response.status_code == 400 and "already taken" in e.response.text: return True raise CommCareHQAPIException( f"{e.response.status_code} Error response {e.response.text} while creating user {user.username}"