aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/context/form.go10
-rw-r--r--modules/notification/mail/mail.go2
2 files changed, 8 insertions, 4 deletions
diff --git a/modules/context/form.go b/modules/context/form.go
index 8d18590973..4f48d746b9 100644
--- a/modules/context/form.go
+++ b/modules/context/form.go
@@ -46,9 +46,11 @@ func (ctx *Context) FormInt64(key string) int64 {
return v
}
-// FormBool returns true if the value for the provided key in the form is "1" or "true"
+// FormBool returns true if the value for the provided key in the form is "1", "true" or "on"
func (ctx *Context) FormBool(key string) bool {
- v, _ := strconv.ParseBool(ctx.Req.FormValue(key))
+ s := ctx.Req.FormValue(key)
+ v, _ := strconv.ParseBool(s)
+ v = v || strings.EqualFold(s, "on")
return v
}
@@ -59,6 +61,8 @@ func (ctx *Context) FormOptionalBool(key string) util.OptionalBool {
if len(value) == 0 {
return util.OptionalBoolNone
}
- v, _ := strconv.ParseBool(ctx.Req.FormValue(key))
+ s := ctx.Req.FormValue(key)
+ v, _ := strconv.ParseBool(s)
+ v = v || strings.EqualFold(s, "on")
return util.OptionalBoolOf(v)
}
diff --git a/modules/notification/mail/mail.go b/modules/notification/mail/mail.go
index 94ee16ff8c..21709d9454 100644
--- a/modules/notification/mail/mail.go
+++ b/modules/notification/mail/mail.go
@@ -42,7 +42,7 @@ func (m *mailNotifier) NotifyCreateIssueComment(doer *user_model.User, repo *rep
act = models.ActionCommentIssue
} else if comment.Type == models.CommentTypeCode {
act = models.ActionCommentIssue
- } else if comment.Type == models.CommentTypePullPush {
+ } else if comment.Type == models.CommentTypePullRequestPush {
act = 0
}