From fafa035b5313cc9e5658e449e98a85f8c871a3a3 Mon Sep 17 00:00:00 2001 From: Flare Date: Sat, 24 Sep 2016 19:54:23 +0800 Subject: [PATCH] Fixed ProdMode variable not being changed by settings --- modules/setting/setting.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/setting/setting.go b/modules/setting/setting.go index cff3e7dbc..77232dd34 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -480,6 +480,16 @@ func NewContext() { }[Cfg.Section("time").Key("FORMAT").MustString("RFC1123")] RunUser = Cfg.Section("").Key("RUN_USER").String() + + switch mode := Cfg.Section("").Key("RUN_USER").String(); mode { + case "prod": + ProdMode = true + case "dev": + ProdMode = false + case "test": + ProdMode = false + } + // Does not check run user when the install lock is off. if InstallLock { currentUser, match := IsRunUserMatchCurrentUser(RunUser)