summaryrefslogtreecommitdiffstats
path: root/api/admin.go
diff options
context:
space:
mode:
Diffstat (limited to 'api/admin.go')
-rw-r--r--api/admin.go11
1 files changed, 2 insertions, 9 deletions
diff --git a/api/admin.go b/api/admin.go
index 568d8f6e8..3ef8c12a8 100644
--- a/api/admin.go
+++ b/api/admin.go
@@ -82,18 +82,11 @@ func saveConfig(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
- if len(cfg.ServiceSettings.ListenAddress) == 0 {
- c.SetInvalidParam("saveConfig", "config")
- return
- }
-
- if cfg.TeamSettings.MaxUsersPerTeam == 0 {
- c.SetInvalidParam("saveConfig", "config")
+ if err := cfg.IsValid(); err != nil {
+ c.Err = err
return
}
- // TODO run some cleanup validators
-
utils.SaveConfig(utils.CfgFileName, cfg)
utils.LoadConfig(utils.CfgFileName)
json := utils.Cfg.ToJson()