diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index 60f9362a..0b4a5841 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -1125,20 +1125,20 @@ class AccountController < ApplicationController def bind_email_or_phone @user = User.current - #begin + begin ActiveRecord::Base.transaction do if params[:type] == "phone" @user.update_attributes!(:phone => params[:value]) reward_grade(@user, @user.id, 'Phone', 500) else @user.update_attributes!(:mail => params[:value]) - Gitlab.client.edit_user_email(@user.gid, :email => @user.mail) if @user.gid + # Gitlab.client.edit_user_email(@user.gid, :email => @user.mail) if @user.gid reward_grade(@user, @user.id, 'Mail', 500) end end - #rescue - # raise ActiveRecord::Rollback - #end + rescue + raise ActiveRecord::Rollback + end redirect_to my_account_path end