diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2020-12-12 00:04:04 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-11 17:04:04 +0100 |
commit | ea914d0f7a65a95229fb769ae7d7d5d98bf72263 (patch) | |
tree | 86a23ab3f373571360af4a1a0548e02e83e15a7a /models | |
parent | b35546631e1efecbdae905d3925c5d76f9b96ded (diff) | |
download | gitea-ea914d0f7a65a95229fb769ae7d7d5d98bf72263.tar.gz gitea-ea914d0f7a65a95229fb769ae7d7d5d98bf72263.zip |
Fix bug for webhook and feishu caused by API changed (#13937)
* Fix bug for webhook
* Fix bug for feishu
Diffstat (limited to 'models')
-rw-r--r-- | models/webhook.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/models/webhook.go b/models/webhook.go index dbad2d3449..9f1b6131af 100644 --- a/models/webhook.go +++ b/models/webhook.go @@ -8,6 +8,7 @@ package models import ( "encoding/json" "fmt" + "strings" "time" "code.gitea.io/gitea/modules/log" @@ -310,6 +311,7 @@ func CreateWebhook(w *Webhook) error { } func createWebhook(e Engine, w *Webhook) error { + w.Type = strings.TrimSpace(w.Type) _, err := e.Insert(w) return err } @@ -547,7 +549,7 @@ func copyDefaultWebhooksToRepo(e Engine, repoID int64) error { // \/ \/ \/ \/ \/ // HookTaskType is the type of an hook task -type HookTaskType string +type HookTaskType = string // Types of hook tasks const ( |