mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-21 06:09:39 +08:00
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:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user