91886a45 by pylemon Committed by astaxie

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

…nstead of return its value.
1 parent a7e60c93
......@@ -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!