Permalink
Browse files

Merge remote-tracking branch 'origin/stable' into pkgr

  • Loading branch information...
crohr committed Dec 14, 2017
2 parents 9991494 + 5748ad6 commit 2fd2a1734feb6eb0f32f433a920dfbe4ff4c5a39
Showing with 5 additions and 0 deletions.
  1. +5 −0 app/controllers/users_controller.rb
@@ -292,6 +292,8 @@ def user_from_params_or_current_user
params[:for_user_id] ? User.find(params[:for_user_id]) : current_user
end
FROM_STAGED = "from_staged"
def create
params.permit(:user_fields)
@@ -314,6 +316,8 @@ def create
if user = User.where(staged: true).find_by(email: params[:email].strip.downcase)
user_params.each { |k, v| user.send("#{k}=", v) }
user.staged = false
user.active = false
user.custom_fields[FROM_STAGED] = true
else
user = User.new(user_params)
end
@@ -608,6 +612,7 @@ def update_activation_email
raise Discourse::InvalidAccess.new unless @user.present?
raise Discourse::InvalidAccess.new if @user.active?
raise Discourse::InvalidAccess.new if current_user.present?
raise Discourse::InvalidAccess.new if @user.custom_fields[FROM_STAGED]
User.transaction do
@user.email = params[:email]

0 comments on commit 2fd2a17

Please sign in to comment.