]> git.openstreetmap.org Git - rails.git/commitdiff
Move errors from email to new_email properly
authorTom Hughes <tom@compton.nu>
Wed, 1 Jan 2025 12:27:05 +0000 (12:27 +0000)
committerTom Hughes <tom@compton.nu>
Sun, 16 Feb 2025 13:56:10 +0000 (13:56 +0000)
app/controllers/concerns/user_methods.rb

index d79ed48d2ca742be14faad6db9f637b09dd247e4..447aea3fce3013ac2734992c4c8648ad612ce339 100644 (file)
@@ -59,8 +59,9 @@ module UserMethods
             # 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!