5fa55ca2 by pylemon

bugfix: if a form field type is bool, valid Required should always return true i…

…nstead of return its value.
1 parent 54ae4bc2
......@@ -64,8 +64,8 @@ func (r Required) IsSatisfied(obj interface{}) bool {
if str, ok := obj.(string); ok {
return len(str) > 0
}
if b, ok := obj.(bool); ok {
return b
if _, ok := obj.(bool); ok {
return true
}
if i, ok := obj.(int); ok {
return i != 0
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!