diff options
author | =Corey Hulen <corey@hulen.com> | 2015-10-27 23:28:37 -0700 |
---|---|---|
committer | =Corey Hulen <corey@hulen.com> | 2015-10-27 23:28:37 -0700 |
commit | 46e2e3ebd9180e0ccbfa7335a586215cf9051b4d (patch) | |
tree | cb88855e3b6be2d4ff7f8b0c9d580b10b1fb8132 /store | |
parent | f0b209fee72251f6262fe3e70019cdf19c110e6c (diff) | |
download | chat-46e2e3ebd9180e0ccbfa7335a586215cf9051b4d.tar.gz chat-46e2e3ebd9180e0ccbfa7335a586215cf9051b4d.tar.bz2 chat-46e2e3ebd9180e0ccbfa7335a586215cf9051b4d.zip |
PLT-340 allow team directory and open invites
Diffstat (limited to 'store')
-rw-r--r-- | store/sql_team_store.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/store/sql_team_store.go b/store/sql_team_store.go index cacc8595e..ebf982ec4 100644 --- a/store/sql_team_store.go +++ b/store/sql_team_store.go @@ -280,8 +280,14 @@ func (s SqlTeamStore) GetAllTeamListing() StoreChannel { go func() { result := StoreResult{} + query := "SELECT * FROM Teams WHERE AllowTeamListing = 1" + + if utils.Cfg.SqlSettings.DriverName == model.DATABASE_DRIVER_POSTGRES { + query = "SELECT * FROM Teams WHERE AllowTeamListing = true" + } + var data []*model.Team - if _, err := s.GetReplica().Select(&data, "SELECT * FROM Teams WHERE AllowTeamListing = 1"); err != nil { + if _, err := s.GetReplica().Select(&data, query); err != nil { result.Err = model.NewAppError("SqlTeamStore.GetAllTeams", "We could not get all teams", err.Error()) } |