Merge pull request #11441 from ioito/hotfix/qx-pm-disable

fix(region): skip disabled project mapping
This commit is contained in:
Zexi Li
2021-06-18 18:32:22 +08:00
committed by GitHub
+7 -1
View File
@@ -123,7 +123,13 @@ type pmCache struct {
func (self *pmCache) GetProjectMapping() (*SProjectMapping, error) {
if len(self.ManagerProjectMappingId) > 0 {
return GetRuleMapping(self.ManagerProjectMappingId)
pm, err := GetRuleMapping(self.ManagerProjectMappingId)
if err != nil {
return nil, errors.Wrapf(err, "GetRuleMapping(%s)", self.ManagerProjectMappingId)
}
if pm.Enabled.IsTrue() {
return pm, nil
}
}
if len(self.AccountProjectMappingId) > 0 {
return GetRuleMapping(self.AccountProjectMappingId)