Skip to content

Commit

Permalink
refactor(analytics): update getting eligibility_types
Browse files Browse the repository at this point in the history
  • Loading branch information
lalver1 committed Aug 15, 2024
1 parent fbc6bcb commit 3821498
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions benefits/core/analytics.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import requests

from benefits import VERSION
from benefits.core.models import EligibilityType
from . import session


Expand Down Expand Up @@ -47,13 +46,12 @@ def __init__(self, request, event_type, **kwargs):
agency_name = agency.long_name if agency else None
flow = session.flow(request)
verifier_name = flow.name if flow else None
eligibility_types = session.eligibility(request)
eligibility_types = EligibilityType.get_names(eligibility_types) if eligibility_types else None
eligibility_type = flow.name if flow else None

self.update_event_properties(
path=request.path,
transit_agency=agency_name,
eligibility_types=eligibility_types,
eligibility_types=eligibility_type,
eligibility_verifier=verifier_name,
)

Expand All @@ -68,7 +66,7 @@ def __init__(self, request, event_type, **kwargs):
referring_domain=refdom,
user_agent=uagent,
transit_agency=agency_name,
eligibility_types=eligibility_types,
eligibility_types=eligibility_type,
eligibility_verifier=verifier_name,
)

Expand Down

0 comments on commit 3821498

Please sign in to comment.