Fix bug for webhook and feishu caused by API changed (#13937)

* Fix bug for webhook

* Fix bug for feishu
This commit is contained in:
2020-12-12 00:04:04 +08:00
committed by GitHub
parent b35546631e
commit ea914d0f7a
3 changed files with 37 additions and 57 deletions

View File

@ -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 (