Skip to content

Commit

Permalink
Fix issue with issue default mail template (#16956) (#16975)
Browse files Browse the repository at this point in the history
Backport #16956

The mail template rendering was failing with the error -
`...vices/mailer/mail.go:301:composeIssueCommentMessages() [E] ExecuteTemplate [issue/default/body]: template: issue/default:65:10: executing "issue/default" at <.i18n.Tr>: can't evaluate field i18n in type *models.Comment`

The issue was the template variable i18n is available in the outer scope.

Fix #16877

Co-authored-by: 6543 <[email protected]>
  • Loading branch information
prasadkatti and 6543 authored Sep 7, 2021
1 parent 1b08dfe commit 30708d9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion templates/mail/issue/default.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
{{end -}}
{{- range .ReviewComments}}
<hr>
{{.i18n.Tr "mail.issue.in_tree_path" .TreePath}}
{{$.i18n.Tr "mail.issue.in_tree_path" .TreePath}}
<div class="review">
<pre>{{.Patch}}</pre>
<div>{{.RenderedContent | Safe}}</div>
Expand Down

0 comments on commit 30708d9

Please sign in to comment.