mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-04 02:12:30 +02:00
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
|
@ -22,7 +22,6 @@ import (
|
|||
"code.gitea.io/gitea/modules/setting"
|
||||
"code.gitea.io/gitea/modules/storage"
|
||||
"code.gitea.io/gitea/modules/structs"
|
||||
"code.gitea.io/gitea/modules/templates"
|
||||
"code.gitea.io/gitea/modules/validation"
|
||||
"code.gitea.io/gitea/modules/web"
|
||||
"code.gitea.io/gitea/modules/web/routing"
|
||||
|
@ -43,7 +42,6 @@ import (
|
|||
context_service "code.gitea.io/gitea/services/context"
|
||||
"code.gitea.io/gitea/services/forms"
|
||||
"code.gitea.io/gitea/services/lfs"
|
||||
"code.gitea.io/gitea/services/mailer"
|
||||
|
||||
_ "code.gitea.io/gitea/modules/session" // to registers all internal adapters
|
||||
|
||||
|
@ -152,8 +150,6 @@ func Routes() *web.Route {
|
|||
common = append(common, h)
|
||||
}
|
||||
|
||||
mailer.InitMailRender(templates.Mailer())
|
||||
|
||||
if setting.Service.EnableCaptcha {
|
||||
// The captcha http.Handler should only fire on /captcha/* so we can just mount this on that url
|
||||
routes.Route("/captcha/*", "GET,HEAD", append(common, captcha.Captchaer(context.GetImageCaptcha()))...)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue