summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorKN4CK3R <admin@oldschoolhack.me>2022-08-08 20:04:28 +0200
committerGitHub <noreply@github.com>2022-08-08 20:04:28 +0200
commit2b101994a6f4724500908226f9a55816062f1da6 (patch)
treec13f682c0a3be130a5ee29a919ef292c41efee95 /routers
parentccf03e19c275057cf9b9c86f3ecfbc1fd60008f5 (diff)
downloadgitea-2b101994a6f4724500908226f9a55816062f1da6.tar.gz
gitea-2b101994a6f4724500908226f9a55816062f1da6.zip
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.
Diffstat (limited to 'routers')
-rw-r--r--routers/web/web.go4
1 files changed, 0 insertions, 4 deletions
diff --git a/routers/web/web.go b/routers/web/web.go
index a9f43fb2c4..34d3de6fde 100644
--- a/routers/web/web.go
+++ b/routers/web/web.go
@@ -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()))...)