Fix issue with issue default mail template (#16956) (#16975)

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 <6543@obermui.de>
This commit is contained in:
Prasad Katti 2021-09-06 19:06:59 -07:00 committed by GitHub
parent 1b08dfeacf
commit 30708d9ffe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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>