cal-itp / benefits

Transit benefits enrollment, minus the paperwork.
https://docs.calitp.org/benefits
GNU Affero General Public License v3.0
27 stars 9 forks source link

Fix: changing languages on the enrollment success page #2179

Closed lalver1 closed 3 months ago

lalver1 commented 3 months ago

Closes #2058

On the enrollment success page, the Django set_language redirect view was redirecting the user to the enrollment index page when the language was changed. Looking at the Django documentation, adding a next parameter in the POST data and explicitly including the enrollment success page url in the context seems to be what was missing.

For all other views, when changing languages, I think we don't see this behavior because the Referer request header contains the address of the same view, but for the enrollment success view, Referer is /enrollment/ (I think because it is called from /enrollment/ initially), so using the next parameter is required.

github-actions[bot] commented 3 months ago

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  benefits/enrollment
  views.py
Project Total  

This report was generated by python-coverage-comment-action