From 41e7eaa670ec78d38536367e14d6ed24e446683f Mon Sep 17 00:00:00 2001 From: Stephen Astels Date: Mon, 6 May 2024 10:26:20 -0400 Subject: [PATCH] add if/else alternative to matching --- app/celery/process_pinpoint_receipts_tasks.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/app/celery/process_pinpoint_receipts_tasks.py b/app/celery/process_pinpoint_receipts_tasks.py index 13fbc83341..b3e0edac52 100644 --- a/app/celery/process_pinpoint_receipts_tasks.py +++ b/app/celery/process_pinpoint_receipts_tasks.py @@ -148,3 +148,22 @@ def determine_pinpoint_status(status: str, provider_response: str) -> Union[str, return NOTIFICATION_PERMANENT_FAILURE return None + + # Alternative: + # + # if "blocked" in response_lower: + # return NOTIFICATION_TECHNICAL_FAILURE + # elif "invalid" in response_lower: + # return NOTIFICATION_TECHNICAL_FAILURE + # elif "is opted out" in response_lower: + # return NOTIFICATION_PERMANENT_FAILURE + # elif "unknown error" in response_lower: + # return NOTIFICATION_TECHNICAL_FAILURE + # elif "exceed max price" in response_lower: + # return NOTIFICATION_TECHNICAL_FAILURE + # elif "Phone carrier is currently unreachable/unavailable" in response_lower: + # return NOTIFICATION_TEMPORARY_FAILURE + # elif "Phone is currently unreachable/unavailable" in response_lower: + # return NOTIFICATION_PERMANENT_FAILURE + # else: + # return None