fix(region): admin update without verification

This commit is contained in:
rainzm
2021-04-22 11:45:59 +08:00
parent 883ad9c76a
commit 7e054ee0fe
+4 -4
View File
@@ -809,10 +809,6 @@ func (r *SReceiver) PreUpdate(ctx context.Context, userCred mcclient.TokenCreden
if err != nil {
log.Errorf("PushCache: %v", err)
}
err = ReceiverManager.TableSpec().InsertOrUpdate(ctx, r)
if err != nil {
log.Errorf("InsertOrUpdate: %v", err)
}
// 管理后台修改联系人,如果修改或者启用手机号和邮箱,无需进行校验
allowScope := policy.PolicyManager.AllowScope(userCred, api.SERVICE_TYPE, ReceiverManager.KeywordPlural(), policy.PolicyActionCreate)
if allowScope == rbacutils.ScopeSystem {
@@ -831,6 +827,10 @@ func (r *SReceiver) PreUpdate(ctx context.Context, userCred mcclient.TokenCreden
r.VerifiedMobile = tristate.True
}
}
err = ReceiverManager.TableSpec().InsertOrUpdate(ctx, r)
if err != nil {
log.Errorf("InsertOrUpdate: %v", err)
}
}
func (r *SReceiver) PostUpdate(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) {