fix(scanner): use new created ormer for transaction

Use new created ormer for transaction in SetDefaultRegistration

Closes #10284

Signed-off-by: He Weiwei <hweiwei@vmware.com>
This commit is contained in:
He Weiwei 2020-01-03 02:19:12 +00:00
parent 76dcedb4f3
commit b90ac468c5

View File

@ -130,7 +130,7 @@ func ListRegistrations(query *q.Query) ([]*Registration, error) {
// SetDefaultRegistration sets the specified registration as default one // SetDefaultRegistration sets the specified registration as default one
func SetDefaultRegistration(UUID string) error { func SetDefaultRegistration(UUID string) error {
o := dao.GetOrmer() o := orm.NewOrm()
err := o.Begin() err := o.Begin()
if err != nil { if err != nil {
return err return err