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 { ...@@ -64,8 +64,8 @@ func (r Required) IsSatisfied(obj interface{}) bool {
64 if str, ok := obj.(string); ok { 64 if str, ok := obj.(string); ok {
65 return len(str) > 0 65 return len(str) > 0
66 } 66 }
67 if b, ok := obj.(bool); ok { 67 if _, ok := obj.(bool); ok {
68 return b 68 return true
69 } 69 }
70 if i, ok := obj.(int); ok { 70 if i, ok := obj.(int); ok {
71 return i != 0 71 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!