mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Cfg: Deduplicate DefaultOrgID code (#93588)
Cfg: Expose DefaultOrgID function
This commit is contained in:
@@ -2051,3 +2051,10 @@ func (cfg *Cfg) readPublicDashboardsSettings() {
|
||||
publicDashboards := cfg.Raw.Section("public_dashboards")
|
||||
cfg.PublicDashboardsEnabled = publicDashboards.Key("enabled").MustBool(true)
|
||||
}
|
||||
|
||||
func (cfg *Cfg) DefaultOrgID() int64 {
|
||||
if cfg.AutoAssignOrg && cfg.AutoAssignOrgId > 0 {
|
||||
return int64(cfg.AutoAssignOrgId)
|
||||
}
|
||||
return int64(1)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user