fix modelarts create bug

This commit is contained in:
mhf
2022-09-19 19:42:23 +08:00
parent ac3b54d7b3
commit a31ed4d14b
9 changed files with 52 additions and 14 deletions
+4
View File
@@ -828,6 +828,10 @@ func NewIPv4AddrValidator(key string) *ValidatorIPv4Addr {
}
var ValidateModel = func(userCred mcclient.TokenCredential, manager db.IStandaloneModelManager, id *string) (db.IModel, error) {
if len(*id) == 0 {
return nil, httperrors.NewMissingParameterError(manager.Keyword())
}
model, err := manager.FetchByIdOrName(userCred, *id)
if err != nil {
if errors.Cause(err) == sql.ErrNoRows {