From 136a20926c921650e83b75cf43d38b654cf3173f Mon Sep 17 00:00:00 2001 From: zeripath Date: Sat, 10 Apr 2021 01:26:08 +0100 Subject: Turn RepoRef and RepoAssignment back into func(*Context) (#15372) Signed-off-by: Andrew Thornton Co-authored-by: techknowlogick --- routers/routes/web.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'routers') diff --git a/routers/routes/web.go b/routers/routes/web.go index 7081b30e54..4815680c99 100644 --- a/routers/routes/web.go +++ b/routers/routes/web.go @@ -691,7 +691,7 @@ func RegisterRoutes(m *web.Route) { }, reqSignIn) // ***** Release Attachment Download without Signin - m.Get("/{username}/{reponame}/releases/download/{vTag}/{fileName}", ignSignIn, context.RepoAssignment(), repo.MustBeNotEmpty, repo.RedirectDownload) + m.Get("/{username}/{reponame}/releases/download/{vTag}/{fileName}", ignSignIn, context.RepoAssignment, repo.MustBeNotEmpty, repo.RedirectDownload) m.Group("/{username}/{reponame}", func() { m.Group("/settings", func() { @@ -771,9 +771,9 @@ func RegisterRoutes(m *web.Route) { ctx.Data["PageIsSettings"] = true ctx.Data["LFSStartServer"] = setting.LFS.StartServer }) - }, reqSignIn, context.RepoAssignment(), context.UnitTypes(), reqRepoAdmin, context.RepoRef()) + }, reqSignIn, context.RepoAssignment, context.UnitTypes(), reqRepoAdmin, context.RepoRef()) - m.Post("/{username}/{reponame}/action/{action}", reqSignIn, context.RepoAssignment(), context.UnitTypes(), repo.Action) + m.Post("/{username}/{reponame}/action/{action}", reqSignIn, context.RepoAssignment, context.UnitTypes(), repo.Action) // Grouping for those endpoints not requiring authentication m.Group("/{username}/{reponame}", func() { @@ -783,7 +783,7 @@ func RegisterRoutes(m *web.Route) { m.Combo("/compare/*", repo.MustBeNotEmpty, reqRepoCodeReader, repo.SetEditorconfigIfExists). Get(ignSignIn, repo.SetDiffViewStyle, repo.SetWhitespaceBehavior, repo.CompareDiff). Post(reqSignIn, context.RepoMustNotBeArchived(), reqRepoPullsReader, repo.MustAllowPulls, bindIgnErr(forms.CreateIssueForm{}), repo.SetWhitespaceBehavior, repo.CompareAndPullRequestPost) - }, context.RepoAssignment(), context.UnitTypes()) + }, context.RepoAssignment, context.UnitTypes()) // Grouping for those endpoints that do require authentication m.Group("/{username}/{reponame}", func() { @@ -890,7 +890,7 @@ func RegisterRoutes(m *web.Route) { m.Post("/restore", repo.RestoreBranchPost) }, context.RepoMustNotBeArchived(), reqRepoCodeWriter, repo.MustBeNotEmpty) - }, reqSignIn, context.RepoAssignment(), context.UnitTypes()) + }, reqSignIn, context.RepoAssignment, context.UnitTypes()) // Releases m.Group("/{username}/{reponame}", func() { @@ -928,11 +928,11 @@ func RegisterRoutes(m *web.Route) { } ctx.Data["CommitsCount"] = ctx.Repo.CommitsCount }) - }, ignSignIn, context.RepoAssignment(), context.UnitTypes(), reqRepoReleaseReader) + }, ignSignIn, context.RepoAssignment, context.UnitTypes(), reqRepoReleaseReader) m.Group("/{username}/{reponame}", func() { m.Post("/topics", repo.TopicsPost) - }, context.RepoAssignment(), context.RepoMustNotBeArchived(), reqRepoAdmin) + }, context.RepoAssignment, context.RepoMustNotBeArchived(), reqRepoAdmin) m.Group("/{username}/{reponame}", func() { m.Group("", func() { @@ -1080,17 +1080,17 @@ func RegisterRoutes(m *web.Route) { }, context.RepoRef(), reqRepoCodeReader) m.Get("/commit/{sha:([a-f0-9]{7,40})}.{ext:patch|diff}", repo.MustBeNotEmpty, reqRepoCodeReader, repo.RawDiff) - }, ignSignIn, context.RepoAssignment(), context.UnitTypes()) + }, ignSignIn, context.RepoAssignment, context.UnitTypes()) m.Group("/{username}/{reponame}", func() { m.Get("/stars", repo.Stars) m.Get("/watchers", repo.Watchers) m.Get("/search", reqRepoCodeReader, repo.Search) - }, ignSignIn, context.RepoAssignment(), context.RepoRef(), context.UnitTypes()) + }, ignSignIn, context.RepoAssignment, context.RepoRef(), context.UnitTypes()) m.Group("/{username}", func() { m.Group("/{reponame}", func() { m.Get("", repo.SetEditorconfigIfExists, repo.Home) - }, goGet, ignSignIn, context.RepoAssignment(), context.RepoRef(), context.UnitTypes()) + }, goGet, ignSignIn, context.RepoAssignment, context.RepoRef(), context.UnitTypes()) m.Group("/{reponame}", func() { m.Group("/info/lfs", func() { -- cgit v1.2.3