Error when trying to save duplicate email


(Allen - Watchman Monitoring) #1

This error was logged on a fully up to date discourse:

Discourse::InvalidParameters (email) /var/www/discourse/app/controllers/users_controller.rb:487:in `change_email’

Repro:

  • Allow emails to be changed
  • visit a user’s profile
  • enter in a duplicate email
  • Get a normal warning

this will be logged:


(Jeff Atwood) #2

Hmm can you repro this @techapj?


(Arpit Jalan) #3

Yes, I was able to repro this. I made two fixes:

  • change button will be disabled when the email is duplicate (i.e. same as user’s current email).

  • In case the new email user provided is already in use by another user than instead of serving 500 (Internal Server Error), 422 error will be served with proper error message.



(Arpit Jalan) #4