Skip to content

Commit

Permalink
refactor: update TransitAgency model to provide eligibility index url
Browse files Browse the repository at this point in the history
  • Loading branch information
angela-tran committed Jan 18, 2023
1 parent bbf7f3e commit 8c388c6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions benefits/core/models.py
Expand Up @@ -238,6 +238,11 @@ def index_url(self):
"""Public-facing URL to the TransitAgency's landing page."""
return reverse("core:agency_index", args=[self.slug])

@property
def eligibility_index_url(self):
"""Public facing URL to the TransitAgency's eligibility page."""
return reverse("eligibility:agency_index", args=[self.slug])

@property
def public_key_url(self):
"""Public-facing URL to the TransitAgency's public key."""
Expand Down
2 changes: 1 addition & 1 deletion benefits/core/views.py
Expand Up @@ -34,7 +34,7 @@ def index(request):
return redirect(agency.index_url)

# generate a button to the landing page for each active agency
buttons = [viewmodels.Button.outline_primary(text=a.short_name, url=a.index_url) for a in agencies]
buttons = [viewmodels.Button.outline_primary(text=a.short_name, url=a.eligibility_index_url) for a in agencies]
buttons[0].classes.append("mt-3")
buttons[0].label = _("core.pages.index.chooseprovider")

Expand Down
2 changes: 1 addition & 1 deletion benefits/eligibility/urls.py
Expand Up @@ -10,7 +10,7 @@
urlpatterns = [
# /eligibility
path("", views.index, name="index"),
path("<agency:agency>", views.index, name="index"),
path("<agency:agency>", views.index, name="agency_index"),
path("start", views.start, name="start"),
path("confirm", views.confirm, name="confirm"),
path("unverified", views.unverified, name="unverified"),
Expand Down

0 comments on commit 8c388c6

Please sign in to comment.