Skip to content

Commit

Permalink
Fix bug for code search if code is disabled (#25173)
Browse files Browse the repository at this point in the history
  • Loading branch information
lunny authored Jun 9, 2023
1 parent 96f9c11 commit feb38da
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion routers/web/web.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,12 @@ func registerRoutes(m *web.Route) {
m.Get("/users", explore.Users)
m.Get("/users/sitemap-{idx}.xml", sitemapEnabled, explore.Users)
m.Get("/organizations", explore.Organizations)
m.Get("/code", reqUnitAccess(unit.TypeCode, perm.AccessModeRead), explore.Code)
m.Get("/code", func(ctx *context.Context) {
if unit.TypeCode.UnitGlobalDisabled() {
ctx.NotFound(unit.TypeCode.String(), nil)
return
}
}, explore.Code)
m.Get("/topics/search", explore.TopicSearch)
}, ignExploreSignIn)
m.Group("/issues", func() {
Expand Down

0 comments on commit feb38da

Please sign in to comment.