修改邮箱报500

dev_haigong
cxt 6 years ago
parent f7b95af92f
commit 03c3729ea3

@ -1125,20 +1125,20 @@ class AccountController < ApplicationController
def bind_email_or_phone def bind_email_or_phone
@user = User.current @user = User.current
#begin begin
ActiveRecord::Base.transaction do ActiveRecord::Base.transaction do
if params[:type] == "phone" if params[:type] == "phone"
@user.update_attributes!(:phone => params[:value]) @user.update_attributes!(:phone => params[:value])
reward_grade(@user, @user.id, 'Phone', 500) reward_grade(@user, @user.id, 'Phone', 500)
else else
@user.update_attributes!(:mail => params[:value]) @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) reward_grade(@user, @user.id, 'Mail', 500)
end end
end end
#rescue rescue
# raise ActiveRecord::Rollback raise ActiveRecord::Rollback
#end end
redirect_to my_account_path redirect_to my_account_path
end end

Loading…
Cancel
Save