diff options
author | zeripath <art27@cantab.net> | 2020-12-14 12:45:33 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-14 20:45:33 +0800 |
commit | d2b308ae3594afa8c2a5f2a797c4723bc4e0e948 (patch) | |
tree | 82211b442de670ebf62ff0645ea978fa4596547b /routers | |
parent | 8e8e8ee150a70e882bf4661fab84382befe29ac0 (diff) | |
download | gitea-d2b308ae3594afa8c2a5f2a797c4723bc4e0e948.tar.gz gitea-d2b308ae3594afa8c2a5f2a797c4723bc4e0e948.zip |
Ensure template renderer is available before storage handler (#13982)
`ctx.Error` requires that templates are available for this to
render the error page otherwise there will be a panic at this
time.
This was fixed in #13164 but was not completely backported.
Fix #13971
Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'routers')
-rw-r--r-- | routers/routes/routes.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/routers/routes/routes.go b/routers/routes/routes.go index 586474a661..a7b5b5b589 100644 --- a/routers/routes/routes.go +++ b/routers/routes/routes.go @@ -223,10 +223,11 @@ func NewMacaron() *macaron.Macaron { }, )) + m.Use(templates.HTMLRenderer()) + m.Use(storageHandler(setting.Avatar.Storage, "avatars", storage.Avatars)) m.Use(storageHandler(setting.RepoAvatar.Storage, "repo-avatars", storage.RepoAvatars)) - m.Use(templates.HTMLRenderer()) mailer.InitMailRender(templates.Mailer()) localeNames, err := options.Dir("locale") |