Commit a714fb79 authored by ale's avatar ale
Browse files

Use the merged context when calling ExecuteTemplate

Fix a bug where global variables were missing.
parent e6ce37fb
......@@ -45,7 +45,7 @@ func (r *Renderer) Render(w http.ResponseWriter, req *http.Request, templateName
// Render the template into a buffer, to prevent returning
// half-rendered templates when there is an error.
var buf bytes.Buffer
if err := r.tpl.ExecuteTemplate(&buf, templateName, data); err != nil {
if err := r.tpl.ExecuteTemplate(&buf, templateName, vars); err != nil {
log.Printf("template rendering error for %s: %v", req.URL.String(), err)
http.Error(w, err.Error(), http.StatusInternalServerError)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment