From 1ce4a94a675faeb3664b4ecc3445d9832781765e Mon Sep 17 00:00:00 2001 From: saint Date: Wed, 26 Jun 2024 15:49:43 +1000 Subject: [PATCH] v0.15.1 Minor fix --- gossamer_forums.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gossamer_forums.rb b/gossamer_forums.rb index f159761..53a5b2f 100644 --- a/gossamer_forums.rb +++ b/gossamer_forums.rb @@ -1,5 +1,5 @@ # gossamer threads migration-import code -# v0.15 +# v0.15.1 require 'mysql2' require 'open-uri' @@ -137,7 +137,7 @@ class GossamerForumsImporter < ImportScripts::Base # Sanitize the username to meet Discourse's requirements def sanitize_username(original_username, email, real_name) # original_username = username - sanitized_username = username.gsub(/[^a-zA-Z0-9._-]/, '_') + sanitized_username = original_username.gsub(/[^a-zA-Z0-9._-]/, '_') sanitized_username = "#{sanitized_username}." if sanitized_username.length < 2 # Allow two-character usernames sanitized_username = sanitized_username[0, 20] if sanitized_username.length > 20 firststep_sanitized = sanitized_username