fix: update
This commit is contained in:
parent
0f95c504a2
commit
568e8f85d2
3 changed files with 3 additions and 3 deletions
|
@ -56,7 +56,7 @@ func createRepoHook(c *gin.Context) {
|
||||||
} `json:"config"`
|
} `json:"config"`
|
||||||
}{}
|
}{}
|
||||||
c.BindJSON(&in)
|
c.BindJSON(&in)
|
||||||
if in.Type != "gogs" ||
|
if in.Type != "gitea" ||
|
||||||
in.Conf.Type != "json" ||
|
in.Conf.Type != "json" ||
|
||||||
in.Conf.URL != "http://localhost" {
|
in.Conf.URL != "http://localhost" {
|
||||||
c.String(500, "")
|
c.String(500, "")
|
||||||
|
|
|
@ -303,7 +303,7 @@ func (c *client) Activate(u *model.User, r *model.Repo, link string) error {
|
||||||
"content_type": "json",
|
"content_type": "json",
|
||||||
}
|
}
|
||||||
hook := gitea.CreateHookOption{
|
hook := gitea.CreateHookOption{
|
||||||
Type: "gogs",
|
Type: "gitea",
|
||||||
Config: config,
|
Config: config,
|
||||||
Events: []string{"push", "create", "pull_request"},
|
Events: []string{"push", "create", "pull_request"},
|
||||||
Active: true,
|
Active: true,
|
||||||
|
|
|
@ -186,7 +186,7 @@ func parsePullRequest(r io.Reader) (*pullRequestHook, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// fixMalformedAvatar is a helper function that fixes an avatar url if malformed
|
// fixMalformedAvatar is a helper function that fixes an avatar url if malformed
|
||||||
// (currently a known bug with gogs)
|
// (currently a known bug with gitea)
|
||||||
func fixMalformedAvatar(url string) string {
|
func fixMalformedAvatar(url string) string {
|
||||||
index := strings.Index(url, "///")
|
index := strings.Index(url, "///")
|
||||||
if index != -1 {
|
if index != -1 {
|
||||||
|
|
Loading…
Reference in a new issue