Backend: Remove more globals (#29644)

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
Arve Knudsen
2020-12-15 19:09:04 +01:00
committed by GitHub
parent aa8fb1ae98
commit dd2d206d99
35 changed files with 526 additions and 484 deletions
+3 -3
View File
@@ -22,7 +22,7 @@ type ReqContext struct {
}
// Handle handles and logs error by given status.
func (ctx *ReqContext) Handle(status int, title string, err error) {
func (ctx *ReqContext) Handle(cfg *setting.Cfg, status int, title string, err error) {
if err != nil {
ctx.Logger.Error(title, "error", err)
if setting.Env != setting.Prod {
@@ -31,10 +31,10 @@ func (ctx *ReqContext) Handle(status int, title string, err error) {
}
ctx.Data["Title"] = title
ctx.Data["AppSubUrl"] = setting.AppSubUrl
ctx.Data["AppSubUrl"] = cfg.AppSubURL
ctx.Data["Theme"] = "dark"
ctx.HTML(status, setting.ErrTemplateName)
ctx.HTML(status, cfg.ErrTemplateName)
}
func (ctx *ReqContext) IsApiRequest() bool {