Migrate "User.UpdateMfaActive" to Sync by default (#11566)
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
e9b82bc1ce
Коммит
903085feb8
@@ -303,16 +303,14 @@ func (us SqlUserStore) UpdateMfaSecret(userId, secret string) *model.AppError {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (us SqlUserStore) UpdateMfaActive(userId string, active bool) store.StoreChannel {
|
||||
return store.Do(func(result *store.StoreResult) {
|
||||
updateAt := model.GetMillis()
|
||||
func (us SqlUserStore) UpdateMfaActive(userId string, active bool) *model.AppError {
|
||||
updateAt := model.GetMillis()
|
||||
|
||||
if _, err := us.GetMaster().Exec("UPDATE Users SET MfaActive = :Active, UpdateAt = :UpdateAt WHERE Id = :UserId", map[string]interface{}{"Active": active, "UpdateAt": updateAt, "UserId": userId}); err != nil {
|
||||
result.Err = model.NewAppError("SqlUserStore.UpdateMfaActive", "store.sql_user.update_mfa_active.app_error", nil, "id="+userId+", "+err.Error(), http.StatusInternalServerError)
|
||||
} else {
|
||||
result.Data = userId
|
||||
}
|
||||
})
|
||||
if _, err := us.GetMaster().Exec("UPDATE Users SET MfaActive = :Active, UpdateAt = :UpdateAt WHERE Id = :UserId", map[string]interface{}{"Active": active, "UpdateAt": updateAt, "UserId": userId}); err != nil {
|
||||
return model.NewAppError("SqlUserStore.UpdateMfaActive", "store.sql_user.update_mfa_active.app_error", nil, "id="+userId+", "+err.Error(), http.StatusInternalServerError)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (us SqlUserStore) Get(id string) (*model.User, *model.AppError) {
|
||||
|
||||
Ссылка в новой задаче
Block a user