mirror of
https://github.com/discourse/discourse.git
synced 2026-07-31 16:48:26 -05:00
The process_user_email method was replacing valid emails with random @email.invalid addresses because the deduplication check treated a user's own email as a duplicate. The @emails hash is populated during import_users, so when import_user_emails runs later, the check !@emails.has_key?(email) fails for the user's own email, triggering the random_email fallback. Updated the condition to allow an email if it belongs to the same user: (!@emails.has_key?(email) || @emails[email] == user_id)