mirror of
https://github.com/grafana/grafana.git
synced 2025-07-30 08:22:44 +08:00
chore: avoid aliasing models in middleware (#22484)
This commit is contained in:
@ -25,7 +25,7 @@ import (
|
||||
"gopkg.in/macaron.v1"
|
||||
|
||||
"github.com/grafana/grafana/pkg/infra/log"
|
||||
m "github.com/grafana/grafana/pkg/models"
|
||||
"github.com/grafana/grafana/pkg/models"
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
)
|
||||
|
||||
@ -106,7 +106,7 @@ func Recovery() macaron.Handler {
|
||||
panicLogger := log.Root
|
||||
// try to get request logger
|
||||
if ctx, ok := c.Data["ctx"]; ok {
|
||||
ctxTyped := ctx.(*m.ReqContext)
|
||||
ctxTyped := ctx.(*models.ReqContext)
|
||||
panicLogger = ctxTyped.Logger
|
||||
}
|
||||
|
||||
@ -138,7 +138,7 @@ func Recovery() macaron.Handler {
|
||||
c.Data["ErrorMsg"] = string(stack)
|
||||
}
|
||||
|
||||
ctx, ok := c.Data["ctx"].(*m.ReqContext)
|
||||
ctx, ok := c.Data["ctx"].(*models.ReqContext)
|
||||
|
||||
if ok && ctx.IsApiRequest() {
|
||||
resp := make(map[string]interface{})
|
||||
|
Reference in New Issue
Block a user