prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Remove agency index pass-through
  With the new Courtesy Card designs, we have a better context-setting Agency Index (homepage). Let's remove the auto-pass-through that currently sends the user straight to Eligibility Start.
  
  ## Acceptance Criteria
  
  <!-- Remember to consider edge cases -->
  
  - [ ] A user lands on the Agency Index page when viewing the Benefits app
  - [ ] The Agency Index continue button takes the user to the Eligibility Index page
  
  ## Additional context
  
  Work on the new homepage is happening in #937
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `benefits/core/views.py`
  Content:
  ```
  1 """
  2 The core application: view definition for the root of the webapp.
  3 """
  4 from django.http import HttpResponse, HttpResponseBadRequest, HttpResponseNotFound, HttpResponseServerError
  5 from django.shortcuts import redirect
  6 from django.template import loader
  7 from django.template.response import TemplateResponse
  8 from django.urls import reverse
  9 from django.utils.translation import gettext as _
  10 
  11 from . import models, session, viewmodels
  12 from .middleware import pageview_decorator
  13 
  14 ROUTE_INDEX = "core:index"
  15 ROUTE_ELIGIBILITY = "eligibility:index"
  16 ROUTE_HELP = "core:help"
  17 
  18 TEMPLATE_PAGE = "core/page.html"
  19 TEMPLATE_AGENCY = "core/agency_index.html"
  20 TEMPLATE_HELP = "core/help.html"
  21 
  22 
  23 @pageview_decorator
  24 def index(request):
  25     """View handler for the main entry page."""
  26     session.reset(request)
  27 
  28     agencies = models.TransitAgency.all_active()
  29 
  30     if len(agencies) == 1:
  31         agency = agencies[0]
  32         return redirect(agency.index_url)
  33 
  34     # generate a button to the landing page for each active agency
  35     buttons = [viewmodels.Button.outline_primary(text=a.short_name, url=a.index_url) for a in agencies]
  36     buttons[0].classes.append("mt-3")
  37     buttons[0].label = _("core.pages.index.chooseprovider")
  38 
  39     page = viewmodels.Page(
  40         title=_("core.pages.index.title"),
  41         headline=_("core.pages.index.headline"),
  42         buttons=buttons,
  43         classes="home",
  44     )
  45 
  46     return TemplateResponse(request, TEMPLATE_PAGE, page.context_dict())
  47 
  48 
  49 @pageview_decorator
  50 def agency_index(request, agency):
  51     """View handler for an agency entry page."""
  52     session.reset(request)
  53     session.update(request, agency=agency, origin=agency.index_url)
  54 
  55     if len(agency.eligibility_verifiers.all()) == 1:
  56         return redirect(reverse(ROUTE_ELIGIBILITY))
  57 
  58     button = viewmodels.Button.primary(text=_("core.pages.index.continue"), url=reverse(ROUTE_ELIGIBILITY))
  59 
  60     page = viewmodels.Page(
  61         title=_("core.pages.agency_index.title"),
  62         headline=_("core.pages.agency_index.mst_cc.headline"),
  63         button=button,
  64         classes="home",
  65     )
  66 
  67     return TemplateResponse(request, TEMPLATE_AGENCY, page.context_dict())
  68 
  69 
  70 @pageview_decorator
  71 def agency_public_key(request, agency):
  72     """View handler returns an agency's public key as plain text."""
  73     return HttpResponse(agency.public_key_data, content_type="text/plain")
  74 
  75 
  76 @pageview_decorator
  77 def help(request):
  78     """View handler for the help page."""
  79     if session.active_agency(request):
  80         agency = session.agency(request)
  81         buttons = viewmodels.Button.agency_contact_links(agency)
  82     else:
  83         buttons = [btn for a in models.TransitAgency.all_active() for btn in viewmodels.Button.agency_contact_links(a)]
  84 
  85     buttons.append(viewmodels.Button.home(request, _("core.buttons.back")))
  86 
  87     page = viewmodels.Page(
  88         title=_("core.buttons.help"),
  89         headline=_("core.buttons.help"),
  90         buttons=buttons,
  91     )
  92 
  93     return TemplateResponse(request, TEMPLATE_HELP, page.context_dict())
  94 
  95 
  96 @pageview_decorator
  97 def bad_request(request, exception, template_name="400.html"):
  98     """View handler for HTTP 400 Bad Request responses."""
  99     if session.active_agency(request):
  100         session.update(request, origin=session.agency(request).index_url)
  101     else:
  102         session.update(request, origin=reverse(ROUTE_INDEX))
  103 
  104     home = viewmodels.Button.home(request)
  105     page = viewmodels.ErrorPage.server_error(button=home)
  106     t = loader.get_template(template_name)
  107 
  108     return HttpResponseBadRequest(t.render(page.context_dict()))
  109 
  110 
  111 @pageview_decorator
  112 def csrf_failure(request, reason):
  113     """
  114     View handler for CSRF_FAILURE_VIEW with custom data.
  115     """
  116     if session.active_agency(request):
  117         session.update(request, origin=session.agency(request).index_url)
  118     else:
  119         session.update(request, origin=reverse(ROUTE_INDEX))
  120 
  121     home = viewmodels.Button.home(request)
  122     page = viewmodels.ErrorPage.not_found(button=home, path=request.path)
  123     t = loader.get_template("400.html")
  124 
  125     return HttpResponseNotFound(t.render(page.context_dict()))
  126 
  127 
  128 @pageview_decorator
  129 def page_not_found(request, exception, template_name="404.html"):
  130     """View handler for HTTP 404 Not Found responses."""
  131     if session.active_agency(request):
  132         session.update(request, origin=session.agency(request).index_url)
  133     else:
  134         session.update(request, origin=reverse(ROUTE_INDEX))
  135 
  136     home = viewmodels.Button.home(request)
  137     # show a more user-friendly message instead of not_found
  138     page = viewmodels.ErrorPage.user_error(button=home, path=request.path)
  139     t = loader.get_template(template_name)
  140 
  141     return HttpResponseNotFound(t.render(page.context_dict()))
  142 
  143 
  144 @pageview_decorator
  145 def server_error(request, template_name="500.html"):
  146     """View handler for HTTP 500 Server Error responses."""
  147     if session.active_agency(request):
  148         session.update(request, origin=session.agency(request).index_url)
  149     else:
  150         session.update(request, origin=reverse(ROUTE_INDEX))
  151 
  152     home = viewmodels.Button.home(request)
  153     page = viewmodels.ErrorPage.server_error(button=home)
  154     t = loader.get_template(template_name)
  155 
  156     return HttpResponseServerError(t.render(page.context_dict()))
  157
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/benefits/core/views.py b/benefits/core/views.py
  --- a/benefits/core/views.py
  +++ b/benefits/core/views.py
  @@ -52,9 +52,6 @@
       session.reset(request)
       session.update(request, agency=agency, origin=agency.index_url)
   
  -    if len(agency.eligibility_verifiers.all()) == 1:
  -        return redirect(reverse(ROUTE_ELIGIBILITY))
  -
       button = viewmodels.Button.primary(text=_("core.pages.index.continue"), url=reverse(ROUTE_ELIGIBILITY))
   
       page = viewmodels.Page(
  
verification_info: {"golden_diff": "diff --git a/benefits/core/views.py b/benefits/core/views.py\n--- a/benefits/core/views.py\n+++ b/benefits/core/views.py\n@@ -52,9 +52,6 @@\n     session.reset(request)\n     session.update(request, agency=agency, origin=agency.index_url)\n \n-    if len(agency.eligibility_verifiers.all()) == 1:\n-        return redirect(reverse(ROUTE_ELIGIBILITY))\n-\n     button = viewmodels.Button.primary(text=_(\"core.pages.index.continue\"), url=reverse(ROUTE_ELIGIBILITY))\n \n     page = viewmodels.Page(\n", "issue": "Remove agency index pass-through\nWith the new Courtesy Card designs, we have a better context-setting Agency Index (homepage). Let's remove the auto-pass-through that currently sends the user straight to Eligibility Start.\r\n\r\n## Acceptance Criteria\r\n\r\n<!-- Remember to consider edge cases -->\r\n\r\n- [ ] A user lands on the Agency Index page when viewing the Benefits app\r\n- [ ] The Agency Index continue button takes the user to the Eligibility Index page\r\n\r\n## Additional context\r\n\r\nWork on the new homepage is happening in #937\n", "before_files": [{"content": "\"\"\"\nThe core application: view definition for the root of the webapp.\n\"\"\"\nfrom django.http import HttpResponse, HttpResponseBadRequest, HttpResponseNotFound, HttpResponseServerError\nfrom django.shortcuts import redirect\nfrom django.template import loader\nfrom django.template.response import TemplateResponse\nfrom django.urls import reverse\nfrom django.utils.translation import gettext as _\n\nfrom . import models, session, viewmodels\nfrom .middleware import pageview_decorator\n\nROUTE_INDEX = \"core:index\"\nROUTE_ELIGIBILITY = \"eligibility:index\"\nROUTE_HELP = \"core:help\"\n\nTEMPLATE_PAGE = \"core/page.html\"\nTEMPLATE_AGENCY = \"core/agency_index.html\"\nTEMPLATE_HELP = \"core/help.html\"\n\n\n@pageview_decorator\ndef index(request):\n    \"\"\"View handler for the main entry page.\"\"\"\n    session.reset(request)\n\n    agencies = models.TransitAgency.all_active()\n\n    if len(agencies) == 1:\n        agency = agencies[0]\n        return redirect(agency.index_url)\n\n    # generate a button to the landing page for each active agency\n    buttons = [viewmodels.Button.outline_primary(text=a.short_name, url=a.index_url) for a in agencies]\n    buttons[0].classes.append(\"mt-3\")\n    buttons[0].label = _(\"core.pages.index.chooseprovider\")\n\n    page = viewmodels.Page(\n        title=_(\"core.pages.index.title\"),\n        headline=_(\"core.pages.index.headline\"),\n        buttons=buttons,\n        classes=\"home\",\n    )\n\n    return TemplateResponse(request, TEMPLATE_PAGE, page.context_dict())\n\n\n@pageview_decorator\ndef agency_index(request, agency):\n    \"\"\"View handler for an agency entry page.\"\"\"\n    session.reset(request)\n    session.update(request, agency=agency, origin=agency.index_url)\n\n    if len(agency.eligibility_verifiers.all()) == 1:\n        return redirect(reverse(ROUTE_ELIGIBILITY))\n\n    button = viewmodels.Button.primary(text=_(\"core.pages.index.continue\"), url=reverse(ROUTE_ELIGIBILITY))\n\n    page = viewmodels.Page(\n        title=_(\"core.pages.agency_index.title\"),\n        headline=_(\"core.pages.agency_index.mst_cc.headline\"),\n        button=button,\n        classes=\"home\",\n    )\n\n    return TemplateResponse(request, TEMPLATE_AGENCY, page.context_dict())\n\n\n@pageview_decorator\ndef agency_public_key(request, agency):\n    \"\"\"View handler returns an agency's public key as plain text.\"\"\"\n    return HttpResponse(agency.public_key_data, content_type=\"text/plain\")\n\n\n@pageview_decorator\ndef help(request):\n    \"\"\"View handler for the help page.\"\"\"\n    if session.active_agency(request):\n        agency = session.agency(request)\n        buttons = viewmodels.Button.agency_contact_links(agency)\n    else:\n        buttons = [btn for a in models.TransitAgency.all_active() for btn in viewmodels.Button.agency_contact_links(a)]\n\n    buttons.append(viewmodels.Button.home(request, _(\"core.buttons.back\")))\n\n    page = viewmodels.Page(\n        title=_(\"core.buttons.help\"),\n        headline=_(\"core.buttons.help\"),\n        buttons=buttons,\n    )\n\n    return TemplateResponse(request, TEMPLATE_HELP, page.context_dict())\n\n\n@pageview_decorator\ndef bad_request(request, exception, template_name=\"400.html\"):\n    \"\"\"View handler for HTTP 400 Bad Request responses.\"\"\"\n    if session.active_agency(request):\n        session.update(request, origin=session.agency(request).index_url)\n    else:\n        session.update(request, origin=reverse(ROUTE_INDEX))\n\n    home = viewmodels.Button.home(request)\n    page = viewmodels.ErrorPage.server_error(button=home)\n    t = loader.get_template(template_name)\n\n    return HttpResponseBadRequest(t.render(page.context_dict()))\n\n\n@pageview_decorator\ndef csrf_failure(request, reason):\n    \"\"\"\n    View handler for CSRF_FAILURE_VIEW with custom data.\n    \"\"\"\n    if session.active_agency(request):\n        session.update(request, origin=session.agency(request).index_url)\n    else:\n        session.update(request, origin=reverse(ROUTE_INDEX))\n\n    home = viewmodels.Button.home(request)\n    page = viewmodels.ErrorPage.not_found(button=home, path=request.path)\n    t = loader.get_template(\"400.html\")\n\n    return HttpResponseNotFound(t.render(page.context_dict()))\n\n\n@pageview_decorator\ndef page_not_found(request, exception, template_name=\"404.html\"):\n    \"\"\"View handler for HTTP 404 Not Found responses.\"\"\"\n    if session.active_agency(request):\n        session.update(request, origin=session.agency(request).index_url)\n    else:\n        session.update(request, origin=reverse(ROUTE_INDEX))\n\n    home = viewmodels.Button.home(request)\n    # show a more user-friendly message instead of not_found\n    page = viewmodels.ErrorPage.user_error(button=home, path=request.path)\n    t = loader.get_template(template_name)\n\n    return HttpResponseNotFound(t.render(page.context_dict()))\n\n\n@pageview_decorator\ndef server_error(request, template_name=\"500.html\"):\n    \"\"\"View handler for HTTP 500 Server Error responses.\"\"\"\n    if session.active_agency(request):\n        session.update(request, origin=session.agency(request).index_url)\n    else:\n        session.update(request, origin=reverse(ROUTE_INDEX))\n\n    home = viewmodels.Button.home(request)\n    page = viewmodels.ErrorPage.server_error(button=home)\n    t = loader.get_template(template_name)\n\n    return HttpResponseServerError(t.render(page.context_dict()))\n", "path": "benefits/core/views.py"}], "after_files": [{"content": "\"\"\"\nThe core application: view definition for the root of the webapp.\n\"\"\"\nfrom django.http import HttpResponse, HttpResponseBadRequest, HttpResponseNotFound, HttpResponseServerError\nfrom django.shortcuts import redirect\nfrom django.template import loader\nfrom django.template.response import TemplateResponse\nfrom django.urls import reverse\nfrom django.utils.translation import gettext as _\n\nfrom . import models, session, viewmodels\nfrom .middleware import pageview_decorator\n\nROUTE_INDEX = \"core:index\"\nROUTE_ELIGIBILITY = \"eligibility:index\"\nROUTE_HELP = \"core:help\"\n\nTEMPLATE_PAGE = \"core/page.html\"\nTEMPLATE_AGENCY = \"core/agency_index.html\"\nTEMPLATE_HELP = \"core/help.html\"\n\n\n@pageview_decorator\ndef index(request):\n    \"\"\"View handler for the main entry page.\"\"\"\n    session.reset(request)\n\n    agencies = models.TransitAgency.all_active()\n\n    if len(agencies) == 1:\n        agency = agencies[0]\n        return redirect(agency.index_url)\n\n    # generate a button to the landing page for each active agency\n    buttons = [viewmodels.Button.outline_primary(text=a.short_name, url=a.index_url) for a in agencies]\n    buttons[0].classes.append(\"mt-3\")\n    buttons[0].label = _(\"core.pages.index.chooseprovider\")\n\n    page = viewmodels.Page(\n        title=_(\"core.pages.index.title\"),\n        headline=_(\"core.pages.index.headline\"),\n        buttons=buttons,\n        classes=\"home\",\n    )\n\n    return TemplateResponse(request, TEMPLATE_PAGE, page.context_dict())\n\n\n@pageview_decorator\ndef agency_index(request, agency):\n    \"\"\"View handler for an agency entry page.\"\"\"\n    session.reset(request)\n    session.update(request, agency=agency, origin=agency.index_url)\n\n    button = viewmodels.Button.primary(text=_(\"core.pages.index.continue\"), url=reverse(ROUTE_ELIGIBILITY))\n\n    page = viewmodels.Page(\n        title=_(\"core.pages.agency_index.title\"),\n        headline=_(\"core.pages.agency_index.mst_cc.headline\"),\n        button=button,\n        classes=\"home\",\n    )\n\n    return TemplateResponse(request, TEMPLATE_AGENCY, page.context_dict())\n\n\n@pageview_decorator\ndef agency_public_key(request, agency):\n    \"\"\"View handler returns an agency's public key as plain text.\"\"\"\n    return HttpResponse(agency.public_key_data, content_type=\"text/plain\")\n\n\n@pageview_decorator\ndef help(request):\n    \"\"\"View handler for the help page.\"\"\"\n    if session.active_agency(request):\n        agency = session.agency(request)\n        buttons = viewmodels.Button.agency_contact_links(agency)\n    else:\n        buttons = [btn for a in models.TransitAgency.all_active() for btn in viewmodels.Button.agency_contact_links(a)]\n\n    buttons.append(viewmodels.Button.home(request, _(\"core.buttons.back\")))\n\n    page = viewmodels.Page(\n        title=_(\"core.buttons.help\"),\n        headline=_(\"core.buttons.help\"),\n        buttons=buttons,\n    )\n\n    return TemplateResponse(request, TEMPLATE_HELP, page.context_dict())\n\n\n@pageview_decorator\ndef bad_request(request, exception, template_name=\"400.html\"):\n    \"\"\"View handler for HTTP 400 Bad Request responses.\"\"\"\n    if session.active_agency(request):\n        session.update(request, origin=session.agency(request).index_url)\n    else:\n        session.update(request, origin=reverse(ROUTE_INDEX))\n\n    home = viewmodels.Button.home(request)\n    page = viewmodels.ErrorPage.server_error(button=home)\n    t = loader.get_template(template_name)\n\n    return HttpResponseBadRequest(t.render(page.context_dict()))\n\n\n@pageview_decorator\ndef csrf_failure(request, reason):\n    \"\"\"\n    View handler for CSRF_FAILURE_VIEW with custom data.\n    \"\"\"\n    if session.active_agency(request):\n        session.update(request, origin=session.agency(request).index_url)\n    else:\n        session.update(request, origin=reverse(ROUTE_INDEX))\n\n    home = viewmodels.Button.home(request)\n    page = viewmodels.ErrorPage.not_found(button=home, path=request.path)\n    t = loader.get_template(\"400.html\")\n\n    return HttpResponseNotFound(t.render(page.context_dict()))\n\n\n@pageview_decorator\ndef page_not_found(request, exception, template_name=\"404.html\"):\n    \"\"\"View handler for HTTP 404 Not Found responses.\"\"\"\n    if session.active_agency(request):\n        session.update(request, origin=session.agency(request).index_url)\n    else:\n        session.update(request, origin=reverse(ROUTE_INDEX))\n\n    home = viewmodels.Button.home(request)\n    # show a more user-friendly message instead of not_found\n    page = viewmodels.ErrorPage.user_error(button=home, path=request.path)\n    t = loader.get_template(template_name)\n\n    return HttpResponseNotFound(t.render(page.context_dict()))\n\n\n@pageview_decorator\ndef server_error(request, template_name=\"500.html\"):\n    \"\"\"View handler for HTTP 500 Server Error responses.\"\"\"\n    if session.active_agency(request):\n        session.update(request, origin=session.agency(request).index_url)\n    else:\n        session.update(request, origin=reverse(ROUTE_INDEX))\n\n    home = viewmodels.Button.home(request)\n    page = viewmodels.ErrorPage.server_error(button=home)\n    t = loader.get_template(template_name)\n\n    return HttpResponseServerError(t.render(page.context_dict()))\n", "path": "benefits/core/views.py"}]}