From 5e82e5e3d1b0707987126607fe24e4ebdd4db3d8 Mon Sep 17 00:00:00 2001 From: saint Date: Wed, 26 Jun 2024 21:01:52 +1000 Subject: [PATCH] v0.15.4 Minor fix --- gossamer_forums.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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}"