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

Why is the value of a Checkbox forced to None? #182

Open
ljean opened this issue Nov 23, 2016 · 0 comments
Open

Why is the value of a Checkbox forced to None? #182

ljean opened this issue Nov 23, 2016 · 0 comments

Comments

@ljean
Copy link

ljean commented Nov 23, 2016

The _format_value of a CheckBoxInput returns None if value is valid (True or False) .

See Line 446

def _format_value(self, value):
        if value in ('', True, False, None):
            value = None
        else:
            value = force_text(value)
        return value

Why don't keep the value as it is rather than returning None? I think this cause a different behavior from other field types.

In my case, it caused a bug when upgrading an application and it was very difficult to find.

Thanks for explaining the reason.

Best
luc

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

No branches or pull requests

1 participant