Skip to content

Boolean inputs lower-cased before being compared to true_values and false_values #282

@grant-humphries

Description

@grant-humphries

When the parameters true_values and false_values are set for a boolean, inputs to fields of that type are checked against the values in those lists, however those input values are being lower cased (see the code here) and the true and false list values are not, leading this code:

node.typ = colander.Boolean(
    false_choices=('false', 'N', '0'),
    true_choices=('true', 'Y')
)

to produce this error:

"Y" is neither in ('false', 'N', '0') nor in ('true', 'Y')

I would suggest that either the lower casing of boolean inputs should be removed, or if these settings are intended to be case insensitive, lowercase the true and false list values before their comparison to inputs and add a note to the docs explaining that case is ignored.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions