remove org deprecation logs (#27788)

This commit is contained in:
Will Browne 2020-09-25 16:51:12 +02:00 committed by GitHub
parent d322417217
commit c764e3c37b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -104,11 +104,6 @@ func (ss *SqlStore) Init() error {
ss.addAlertNotificationUidByIdHandler()
ss.addPreferencesQueryAndCommandHandlers()
err = ss.logOrgsNotice()
if err != nil {
return err
}
if ss.skipEnsureDefaultOrgAndUser {
return nil
}
@ -116,30 +111,6 @@ func (ss *SqlStore) Init() error {
return ss.ensureMainOrgAndAdminUser()
}
func (ss *SqlStore) logOrgsNotice() error {
type targetCount struct {
Count int64
}
return ss.WithDbSession(context.Background(), func(session *DBSession) error {
resp := make([]*targetCount, 0)
if err := session.SQL("select count(id) as Count from org").Find(&resp); err != nil {
return err
}
if resp[0].Count > 1 {
ss.log.Warn(`[Deprecation notice]`)
ss.log.Warn(`Fewer than 1% of Grafana installations use organizations, and we feel that most of those`)
ss.log.Warn(`users would have a better experience using Teams instead. As such, we are considering de-emphasizing`)
ss.log.Warn(`and eventually deprecating Organizations in a future Grafana release. If you would like to provide`)
ss.log.Warn(`feedback or describe your need, please do so in the issue linked below`)
ss.log.Warn(`https://github.com/grafana/grafana/issues/24588`)
}
return nil
})
}
func (ss *SqlStore) ensureMainOrgAndAdminUser() error {
err := ss.InTransaction(context.Background(), func(ctx context.Context) error {
systemUserCountQuery := models.GetSystemUserCountStatsQuery{}