Remove more global refs / state (#7723)

* remove more global refs / state

* fix job enterprise initialization

* fix api4 test compilation

* saml api endpoints fix
Этот коммит содержится в:
Chris
2017-10-26 14:21:22 -05:00
коммит произвёл Joram Wilander
родитель a0bfd2885d
Коммит 7ed011745a
23 изменённых файлов: 129 добавлений и 150 удалений

Просмотреть файл

@@ -400,7 +400,7 @@ func removeCertificate(c *Context, w http.ResponseWriter, r *http.Request) {
}
func samlCertificateStatus(c *Context, w http.ResponseWriter, r *http.Request) {
status := app.GetSamlCertificateStatus()
status := c.App.GetSamlCertificateStatus()
statusMap := map[string]interface{}{}
statusMap["IdpCertificateFile"] = status.IdpCertificateFile

Просмотреть файл

@@ -114,15 +114,6 @@ func Setup() *TestHelper {
return setupTestHelper(false)
}
func ReloadConfigForSetup() {
utils.LoadConfig("config.json")
utils.InitTranslations(utils.Cfg.LocalizationSettings)
*utils.Cfg.TeamSettings.MaxUsersPerTeam = 50
*utils.Cfg.RateLimitSettings.Enable = false
utils.Cfg.EmailSettings.SendEmailNotifications = true
*utils.Cfg.TeamSettings.EnableOpenServer = true
}
func (me *TestHelper) InitBasic() *TestHelper {
me.waitForConnectivity()

Просмотреть файл

@@ -205,7 +205,6 @@ func TestStatuses(t *testing.T) {
}
func TestGetStatusesByIds(t *testing.T) {
ReloadConfigForSetup()
th := Setup().InitBasic()
defer th.TearDown()

Просмотреть файл

@@ -292,7 +292,7 @@ func getInitialLoad(c *Context, w http.ResponseWriter, r *http.Request) {
il.TeamMembers = c.Session.TeamMembers
}
if app.SessionCacheLength() == 0 {
if c.App.SessionCacheLength() == 0 {
// Below is a special case when intializating a new server
// Lets check to make sure the server is really empty