diff --git a/gossamer_forums.rb b/gossamer_forums.rb index 9bab191..5318ee6 100644 --- a/gossamer_forums.rb +++ b/gossamer_forums.rb @@ -1,5 +1,5 @@ # gossamer threads migration-import code -# v0.15.3 +# v0.15.4 require 'mysql2' require 'open-uri' @@ -145,9 +145,11 @@ class GossamerForumsImporter < ImportScripts::Base existing_user = User.find_by(username: sanitized_username) if existing_user - if existing_user.email.downcase == email.downcase && existing_user.name == name + if existing_user.email.downcase == email.downcase && existing_user.name == real_name + # The existing user with the username the same as the current proposed sanitised name _is_ the same person... return sanitized_username else + # We cannot clobber another person with the same proposed username, so we resolve the conflict counter = 1 while User.exists?(username: sanitized_username) sanitized_username = "#{firststep_sanitized}_#{counter}"