mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-01 15:07:17 +08:00
fix: rename check when change project (#23680)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
This commit is contained in:
@@ -459,10 +459,13 @@ func (model *SVirtualResourceBase) PerformChangeOwner(ctx context.Context, userC
|
||||
model.cleanModelUsages(ctx, userCred)
|
||||
|
||||
oldName := model.Name
|
||||
newName, err := GenerateName2(ctx, manager, ownerId, oldName, model, 1)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "GenerateName2")
|
||||
}
|
||||
_, err = Update(model, func() error {
|
||||
model.Name, err = GenerateName(ctx, manager, ownerId, oldName)
|
||||
if err != nil {
|
||||
return err
|
||||
if newName != oldName {
|
||||
model.Name = newName
|
||||
}
|
||||
model.DomainId = ownerId.GetProjectDomainId()
|
||||
model.ProjectId = ownerId.GetProjectId()
|
||||
|
||||
Reference in New Issue
Block a user