diff options
author | Unknwon <u@gogs.io> | 2017-03-24 16:32:14 -0400 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2017-03-24 16:32:14 -0400 |
commit | 674106c7b6f916b1f002f8c29ce790337bc615a5 (patch) | |
tree | ccb4be2805ac99c6a0f74f9ba3776371be7be8e3 | |
parent | 8196430f47842fba4f227b105cd96d4b981d077d (diff) |
repo: cleanup some code
-rw-r--r-- | cmd/web.go | 5 | ||||
-rw-r--r-- | models/repo.go | 4 | ||||
-rw-r--r-- | modules/context/repo.go | 1 |
3 files changed, 5 insertions, 5 deletions
@@ -512,6 +512,9 @@ func runWeb(ctx *cli.Context) error { m.Post("", repo.UpdateCommentContent) m.Post("/delete", repo.DeleteComment) }) + + m.Get("/labels/", repo.RetrieveLabels, repo.Labels) + m.Get("/milestones", repo.Milestones) }, ignSignIn, context.RepoAssignment(true)) m.Group("/:username/:reponame", func() { m.Group("/wiki", func() { @@ -597,8 +600,6 @@ func runWeb(ctx *cli.Context) error { m.Get("/releases", repo.MustBeNotBare, repo.Releases) m.Get("/pulls", repo.RetrieveLabels, repo.Pulls) m.Get("/pulls/:index", repo.ViewPull) - m.Get("/labels/", repo.RetrieveLabels, repo.Labels) - m.Get("/milestones", repo.Milestones) }, context.RepoRef()) m.Group("/branches", func() { diff --git a/models/repo.go b/models/repo.go index 0656f83d..d19010a1 100644 --- a/models/repo.go +++ b/models/repo.go @@ -261,11 +261,11 @@ func (repo *Repository) IsPartialPublic() bool { } func (repo *Repository) CanGuestViewWiki() bool { - return repo.IsPartialPublic() && repo.EnableWiki && !repo.EnableExternalWiki && repo.AllowPublicWiki + return repo.EnableWiki && !repo.EnableExternalWiki && repo.AllowPublicWiki } func (repo *Repository) CanGuestViewIssues() bool { - return repo.IsPartialPublic() && repo.EnableIssues && !repo.EnableExternalTracker && repo.AllowPublicIssues + return repo.EnableIssues && !repo.EnableExternalTracker && repo.AllowPublicIssues } // MustOwner always returns a valid *User object to avoid conceptually impossible error handling. diff --git a/modules/context/repo.go b/modules/context/repo.go index 338289a4..c93c0ded 100644 --- a/modules/context/repo.go +++ b/modules/context/repo.go @@ -142,7 +142,6 @@ func RepoAssignment(pages ...bool) macaron.Handler { if len(pages) > 1 { isWikiPage = pages[1] } - _, _ = isIssuesPage, isWikiPage ownerName := ctx.Params(":username") repoName := strings.TrimSuffix(ctx.Params(":reponame"), ".git") |