Files
discourse/script/bulk_import
Ruben Oussoren ba0a319dee FIX email deduplication incorrectly replacing valid user emails (#37824)
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)
2026-02-13 16:42:16 -05:00
..