Backend: Remove more globals (#29644)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user