fix: 仅当变更domainId时才需要更新projectId

This commit is contained in:
Qu Xuan
2020-04-21 21:14:39 +08:00
parent 37e6b25f4a
commit 882c5ddc86
+4 -2
View File
@@ -182,8 +182,10 @@ func (self *SExternalProject) SyncWithCloudProject(ctx context.Context, userCred
diff, err := db.UpdateWithLock(ctx, self, func() error {
self.Name = ext.GetName()
self.IsEmulated = ext.IsEmulated()
self.ProjectId = provider.ProjectId
self.DomainId = provider.DomainId
if self.DomainId != provider.DomainId {
self.ProjectId = provider.ProjectId
self.DomainId = provider.DomainId
}
return nil
})
if err != nil {