Preferences: Fixing preference PUT validation (#68557)

This commit is contained in:
Torkel Ödegaard 2023-05-16 19:38:51 +02:00 committed by GitHub
parent 8390fcc80f
commit 3ffbd2a1db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -128,7 +128,7 @@ func (hs *HTTPServer) UpdateUserPreferences(c *contextmodel.ReqContext) response
}
func (hs *HTTPServer) updatePreferencesFor(ctx context.Context, orgID, userID, teamId int64, dtoCmd *dtos.UpdatePrefsCmd) response.Response {
if !pref.IsValidThemeID(dtoCmd.Theme) {
if dtoCmd.Theme != "" && !pref.IsValidThemeID(dtoCmd.Theme) {
return response.Error(http.StatusBadRequest, "Invalid theme", nil)
}