Skip to content

Commit

Permalink
Move errors from email to new_email properly
Browse files Browse the repository at this point in the history
  • Loading branch information
tomhughes committed Jan 19, 2025
1 parent d223270 commit 368ea65
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/controllers/concerns/user_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ def update_user(user, params)
# Ignore errors sending email
end
else
current_user.errors.add(:new_email, current_user.errors[:email])
current_user.errors.add(:email, [])
current_user.errors.delete(:email).each do |error|
current_user.errors.add(:new_email, error)
end
end

user.restore_email!
Expand Down

0 comments on commit 368ea65

Please sign in to comment.