diff options
author | unknwon <u@gogs.io> | 2019-08-08 23:53:43 -0700 |
---|---|---|
committer | unknwon <u@gogs.io> | 2019-08-08 23:53:43 -0700 |
commit | c7ba519af2f2d8e79077d2776cb34f8b61556471 (patch) | |
tree | 5ca130efd9b4aa8cb51e3db992b918d3af36d9b4 /pkg/context | |
parent | 04de9778553adc376d43db21d40a6b93808c9913 (diff) |
routes/api/v1: codemod
Diffstat (limited to 'pkg/context')
-rw-r--r-- | pkg/context/api.go | 6 | ||||
-rw-r--r-- | pkg/context/repo.go | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/pkg/context/api.go b/pkg/context/api.go index a8928fc0..dec7cfba 100644 --- a/pkg/context/api.go +++ b/pkg/context/api.go @@ -25,8 +25,8 @@ type APIContext struct { Org *APIOrganization } -// FIXME: move to github.com/gogs/go-gogs-client -const DOC_URL = "https://github.com/gogs/docs-api" +// FIXME: move this constant to github.com/gogs/go-gogs-client +const DocURL = "https://github.com/gogs/docs-api" // Error responses error message to client with given message. // If status is 500, also it prints error to log. @@ -44,7 +44,7 @@ func (c *APIContext) Error(status int, title string, obj interface{}) { c.JSON(status, map[string]string{ "message": message, - "url": DOC_URL, + "url": DocURL, }) } diff --git a/pkg/context/repo.go b/pkg/context/repo.go index d7c9f0ce..cb2413f8 100644 --- a/pkg/context/repo.go +++ b/pkg/context/repo.go @@ -160,9 +160,9 @@ func RepoAssignment(pages ...bool) macaron.Handler { if c.IsLogged && c.User.IsAdmin { c.Repo.AccessMode = models.ACCESS_MODE_OWNER } else { - mode, err := models.AccessLevel(c.UserID(), repo) + mode, err := models.UserAccessMode(c.UserID(), repo) if err != nil { - c.ServerError("AccessLevel", err) + c.ServerError("UserAccessMode", err) return } c.Repo.AccessMode = mode |