mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 06:41:25 +08:00
fix user lookup by email in disqus import script
This commit is contained in:
@ -67,7 +67,7 @@ class ImportScripts::Disqus < ImportScripts::Base
|
||||
|
||||
puts "Creating #{title}... (#{t[:posts].size} posts)"
|
||||
|
||||
topic_user = User.where('email = ? OR username = ?', t[:author_email].downcase, t[:author_username]).first
|
||||
topic_user = find_existing_user(t[:author_email], t[:author_username])
|
||||
begin
|
||||
post = TopicEmbed.import_remote(topic_user, t[:link], title: title)
|
||||
post.topic.update_column(:category_id, @category.id)
|
||||
@ -77,7 +77,7 @@ class ImportScripts::Disqus < ImportScripts::Base
|
||||
|
||||
if post.present? && post.topic.posts_count <= 1
|
||||
(t[:posts] || []).each do |p|
|
||||
post_user = User.where('email = ? OR username = ?', (p[:author_email] || '').downcase, p[:author_username]).first
|
||||
post_user = find_existing_user(p[:author_email] || '', p[:author_username])
|
||||
next unless post_user.present?
|
||||
|
||||
attrs = {
|
||||
|
Reference in New Issue
Block a user