mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-09-28 18:14:41 +00:00
Extend Logging & Report to WebHook Caller back if pulls are disabled (#369)
* Add more logging * Format Code * Add TODOs * Fix nits * Delete two unused functions * Report to WebHook Caller back if pulls are disabled
This commit is contained in:
@@ -38,18 +38,6 @@ func Repo(c *gin.Context) *model.Repo {
|
||||
return r
|
||||
}
|
||||
|
||||
func Repos(c *gin.Context) []*model.RepoLite {
|
||||
v, ok := c.Get("repos")
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
r, ok := v.([]*model.RepoLite)
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
func SetRepo() gin.HandlerFunc {
|
||||
return func(c *gin.Context) {
|
||||
var (
|
||||
@@ -93,7 +81,6 @@ func Perm(c *gin.Context) *model.Perm {
|
||||
}
|
||||
|
||||
func SetPerm() gin.HandlerFunc {
|
||||
|
||||
return func(c *gin.Context) {
|
||||
user := User(c)
|
||||
repo := Repo(c)
|
||||
|
@@ -36,18 +36,6 @@ func User(c *gin.Context) *model.User {
|
||||
return u
|
||||
}
|
||||
|
||||
func Token(c *gin.Context) *token.Token {
|
||||
v, ok := c.Get("token")
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
u, ok := v.(*token.Token)
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
return u
|
||||
}
|
||||
|
||||
func SetUser() gin.HandlerFunc {
|
||||
return func(c *gin.Context) {
|
||||
var user *model.User
|
||||
|
Reference in New Issue
Block a user