2
0
Fork 0

fix: fix default form value logic for bool checkbox fields

This commit is contained in:
Lance Edgar 2024-11-24 17:20:29 -06:00
parent 24ddb7b905
commit 3d9fbd598e

View file

@ -1002,7 +1002,7 @@ class Form:
# for now we explicitly translate here, ugh. also # for now we explicitly translate here, ugh. also
# note this does not yet allow for null values.. :( # note this does not yet allow for null values.. :(
if isinstance(field.typ, colander.Boolean): if isinstance(field.typ, colander.Boolean):
value = True if field.typ.true_val else False value = True if value == field.typ.true_val else False
model_data[field.oid] = make_json_safe(value) model_data[field.oid] = make_json_safe(value)