v0.58 Final user import and personal message import run

This commit is contained in:
David Sainty 2024-08-31 23:22:10 +10:00
parent e468a356ff
commit b424be35c6

View File

@ -629,7 +629,8 @@ class GossamerForumsImporter < ImportScripts::Base
email = row['user_email']
# Check if the user already exists in Discourse by username or email
existing_user = User.find_by(username: username) || User.find_by(email: email)
# existing_user = User.find_by(username: username) || User.find_by(email: email)
existing_user = User.find_by(username: username) || User.joins(:user_emails).find_by(user_emails: { email: email })
# Only add the user if they do not already exist
unless existing_user