From 1ec9e906dc905c3d0aacb14e6c8077032dc6a484 Mon Sep 17 00:00:00 2001 From: zeripath Date: Thu, 17 Jun 2021 00:32:57 +0100 Subject: [PATCH] Ensure settings for Service and Mailer are read on the install page (#15943) * Ensure settings for Service and Mailer are read on the install page NewContext does not set the mailer or service settings so add a new function that will run this. Fix #15894 Signed-off-by: Andrew Thornton * placate lint Signed-off-by: Andrew Thornton --- modules/setting/setting.go | 6 ++++++ routers/install/setting.go | 1 + 2 files changed, 7 insertions(+) diff --git a/modules/setting/setting.go b/modules/setting/setting.go index 6e05df1ad9..d26c054cd7 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -1190,3 +1190,9 @@ func NewServices() { newProject() newMimeTypeMap() } + +// NewServicesForInstall initializes the services for install +func NewServicesForInstall() { + newService() + newMailService() +} diff --git a/routers/install/setting.go b/routers/install/setting.go index 50bb6aa355..53d166ba1d 100644 --- a/routers/install/setting.go +++ b/routers/install/setting.go @@ -28,6 +28,7 @@ func PreloadSettings(ctx context.Context) bool { log.Info("SQLite3 Supported") } setting.InitDBConfig() + setting.NewServicesForInstall() svg.Init() } -- 2.39.5