Skip to content

Conversation

kieranyyu
Copy link
Contributor

@kieranyyu kieranyyu commented May 19, 2025

When setting the value of a flag, check only if is_flag is True and flag_value is not provided when negating the default flag value.

#2829 introduced a bug by checking if the type of the flag is None before setting the value.
Since we still check if is_flag is set, objects without a __bool__ method will not raise an error if is_flag is not set.

fixes #2894
fixes #2897

@davidism davidism added this to the 8.2.1 milestone May 19, 2025
@kieranyyu kieranyyu force-pushed the fix-is-flag-with-type branch from d5bb990 to 3120a70 Compare May 19, 2025 20:05
Co-authored-by: Nate Herbert <nateherbert@gmail.com>
@kieranyyu kieranyyu force-pushed the fix-is-flag-with-type branch from e6e99a0 to 4fd2fea Compare May 20, 2025 12:35
@davidism davidism merged commit 884af5c into pallets:stable May 20, 2025
10 checks passed
@kieranyyu kieranyyu deleted the fix-is-flag-with-type branch May 20, 2025 14:56
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants