Skip to content

fix install 500 error #21497

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions models/system/setting.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ func GetSetting(key string) (*Setting, error) {

// GetSettings returns specific settings
func GetSettings(keys []string) (map[string]*Setting, error) {
if db.DefaultContext == nil {
return map[string]*Setting{}, nil
}

for i := 0; i < len(keys); i++ {
keys[i] = strings.ToLower(keys[i])
}
Expand Down
1 change: 0 additions & 1 deletion routers/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,6 @@ func SubmitInstall(ctx *context.Context) {
ctx.RenderWithErr(ctx.Tr("install.invalid_db_setting", err), tplInstall, &form)
return
}
db.UnsetDefaultEngine()
Copy link
Member Author

@a1012112796 a1012112796 Oct 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

woder why unset? is it necessary? how about move it to line 583 (before srv.Shutdown() ). thanks


// Save settings.
cfg := ini.Empty()
Expand Down