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

Handle False boolean overflow triggers, not just True #849

Merged
merged 1 commit into from
May 1, 2024

Conversation

nonprofittechy
Copy link
Member

@nonprofittechy nonprofittechy commented Apr 30, 2024

It's possible to set a boolean as the overflow_trigger for an ALAddendumField when the conditions for triggering the addendum don't depend on the length of a list or string. But we weren't properly handling the condition where the boolean was False.

This handles the False condition in the overflow trigger by returning an empty string, which will result in has_overflow() returning False.

This situation may be a bit unusual, but it might be worth using this pattern when the conditional text is required to be added to the same addendum as other overflow text. In other situations, it would make more sense to create a standard ALDocument with the enabled value set.

This also fixes a production bug in the Vermont Divorce package.

Copy link

@samglover samglover left a comment

Choose a reason for hiding this comment

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

Looks good!

@nonprofittechy nonprofittechy merged commit 05f5485 into main May 1, 2024
5 checks passed
@nonprofittechy nonprofittechy deleted the addendum-safety branch August 13, 2024 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants