mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-01 15:07:17 +08:00
fix: show delele fail reason if cannot delete a resource
This commit is contained in:
@@ -670,15 +670,16 @@ func getModelExtraDetails(item IModel, ctx context.Context, extra *jsonutils.JSO
|
||||
err := item.ValidateDeleteCondition(ctx)
|
||||
if err != nil {
|
||||
extra.Add(jsonutils.JSONFalse, "can_delete")
|
||||
extra.Add(jsonutils.NewString(err.Error()), "delete_fail_reason")
|
||||
} else {
|
||||
extra.Add(jsonutils.JSONTrue, "can_delete")
|
||||
}
|
||||
err = item.ValidateUpdateCondition(ctx)
|
||||
/* err = item.ValidateUpdateCondition(ctx)
|
||||
if err != nil {
|
||||
extra.Add(jsonutils.JSONFalse, "can_update")
|
||||
} else {
|
||||
extra.Add(jsonutils.JSONTrue, "can_update")
|
||||
}
|
||||
}*/
|
||||
return extra
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user