From 8115035f24ffe41871b13c8e231f9c13ce488577 Mon Sep 17 00:00:00 2001 From: Luis Alvergue Date: Thu, 15 Aug 2024 13:39:32 +0000 Subject: [PATCH] refactor(verify): return a boolean instead of an eligibility_type --- benefits/eligibility/verify.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/benefits/eligibility/verify.py b/benefits/eligibility/verify.py index f2402ca44..728f9a1d5 100644 --- a/benefits/eligibility/verify.py +++ b/benefits/eligibility/verify.py @@ -21,18 +21,18 @@ def eligibility_from_api(flow: models.EnrollmentFlow, form, agency: models.Trans timeout=settings.REQUESTS_TIMEOUT, ) - response = client.verify(sub, name, agency.type_names_to_verify(flow)) + response = client.verify(sub, name, [flow.name]) if response.error and any(response.error): return None - elif any(response.eligibility): - return list(response.eligibility) + elif [flow.name] == response.eligibility: + return True else: - return [] + return False def eligibility_from_oauth(flow: models.EnrollmentFlow, oauth_claim, agency: models.TransitAgency): if flow.uses_claims_verification and flow.claims_claim == oauth_claim: - return agency.type_names_to_verify(flow) + return True else: - return [] + return False