forked from kevadesu/forgejo
Fix init mail render logic (#20704)
This bug affects tests which are sending emails (#20307). Some tests reinitialise the web routes (like `TestNodeinfo`) which messed up the mail templates. There is no reason why the templates should be loaded in the routes method.
This commit is contained in:
parent
ccf03e19c2
commit
2b101994a6
4 changed files with 17 additions and 29 deletions
|
@ -24,6 +24,7 @@ import (
|
|||
"code.gitea.io/gitea/modules/process"
|
||||
"code.gitea.io/gitea/modules/queue"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
"code.gitea.io/gitea/modules/templates"
|
||||
|
||||
"github.com/jaytaylor/html2text"
|
||||
"gopkg.in/gomail.v2"
|
||||
|
@ -379,6 +380,8 @@ func NewContext() {
|
|||
}, &Message{})
|
||||
|
||||
go graceful.GetManager().RunWithShutdownFns(mailQueue.Run)
|
||||
|
||||
subjectTemplates, bodyTemplates = templates.Mailer()
|
||||
}
|
||||
|
||||
// SendAsync send mail asynchronously
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue