Merge pull request #59 in YUNIONIO/onecloud from ~QUXUAN/onecloud:bugfix/qx-create-data-check to release/2.1.0

* commit '7d1d1d1d3759474e104758ab29cb433f961ce2c7':
  修复check create data 使用keyword而不是keywordplural
This commit is contained in:
邱剑
2018-08-15 21:45:44 +08:00
+6 -1
View File
@@ -841,7 +841,12 @@ func (dispatcher *DBModelDispatcher) PerformClassAction(ctx context.Context, act
managerValue := reflect.ValueOf(dispatcher.modelManager)
if action == "check-create-data" {
return dispatcher.modelManager.ValidateCreateData(ctx, userCred, ownerProjId, query, data.(*jsonutils.JSONDict))
manager := dispatcher.modelManager
if body, err := data.(*jsonutils.JSONDict).Get(manager.Keyword()); err != nil {
return nil, httperrors.NewGeneralError(err)
} else {
return manager.ValidateCreateData(ctx, userCred, ownerProjId, query, body.(*jsonutils.JSONDict))
}
}
return objectPerformAction(dispatcher, managerValue, ctx, userCred, action, query, data)
}