Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: verifier help templates #2169

Merged
merged 1 commit into from
Jun 14, 2024
Merged

Fix: verifier help templates #2169

merged 1 commit into from
Jun 14, 2024

Conversation

angela-tran
Copy link
Member

This PR fixes #2168 by making sure the context variable agency.help_templates doesn't include empty strings.

The logic previously did not consider the case where the admin interface populates the help_template as an empty string rather than None. If you load an EligibilityVerifier fixture that doesn't specify help_template, the field gets set as None.

when the admin interface saves back a blank TextField, it saves it as
an empty string.
@angela-tran angela-tran self-assigned this Jun 14, 2024
@angela-tran angela-tran requested a review from a team as a code owner June 14, 2024 17:45
@github-actions github-actions bot added deployment-dev [auto] Changes that will trigger a deploy if merged to dev back-end Django views, sessions, middleware, models, migrations etc. labels Jun 14, 2024
Copy link

Coverage report

This PR does not seem to contain any modification to coverable code.

@angela-tran
Copy link
Member Author

angela-tran commented Jun 14, 2024

The Help page on dev-benefits.calitp.org was not working with MST as the selected transit provider because its CalFresh verifier had no help_template. I added core/includes/help--calfresh.html as the help_template to fix that. This fix is still important though because any time the admin interface saves/updates an EligibilityVerifier with an empty help_template, it'll be saved back as an empty string.

Copy link
Member

@lalver1 lalver1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixed it! 👍 I was able to locally recreate the issue in #2168 and confirmed that this PR filters out empty strings.

@angela-tran angela-tran merged commit 31e1f31 into dev Jun 14, 2024
18 checks passed
@angela-tran angela-tran deleted the fix/help-templates branch June 14, 2024 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
back-end Django views, sessions, middleware, models, migrations etc. deployment-dev [auto] Changes that will trigger a deploy if merged to dev
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Help page breaks when adding a new EligibilityVerifier through admin interface
2 participants