mirror of
https://github.com/kataras/iris.git
synced 2025-12-17 09:57:01 +00:00
Fix django view engine and context.ViewData
Former-commit-id: e16a9ef0241f83c4b9a7ebd3b5b7663b33fb070a
This commit is contained in:
@@ -14,6 +14,7 @@ import (
|
||||
"sync"
|
||||
|
||||
"github.com/flosch/pongo2"
|
||||
"github.com/kataras/iris/context"
|
||||
)
|
||||
|
||||
type (
|
||||
@@ -269,6 +270,10 @@ func getPongoContext(templateData interface{}) pongo2.Context {
|
||||
return contextData
|
||||
}
|
||||
|
||||
if contextData, isContextViewData := templateData.(context.Map); isContextViewData {
|
||||
return pongo2.Context(contextData)
|
||||
}
|
||||
|
||||
return templateData.(map[string]interface{})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user