Skip to content

Commit

Permalink
refactor(verify): return a boolean instead of an eligibility_type
Browse files Browse the repository at this point in the history
  • Loading branch information
lalver1 committed Aug 15, 2024
1 parent 3821498 commit 8115035
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions benefits/eligibility/verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 8115035

Please sign in to comment.