DEV: Import script should use case-insensitive check for tag names (#26699)

This commit is contained in:
Gerhard Schlager 2024-04-29 19:27:28 +02:00 committed by GitHub
parent 8dd883d4e5
commit a538e2f153
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -1759,7 +1759,10 @@ class BulkImport::Generic < BulkImport::Base
tags.each do |row|
cleaned_tag_name = DiscourseTagging.clean_tag(row["name"])
tag = Tag.find_or_create_by!(name: cleaned_tag_name)
tag =
Tag.where("LOWER(name) = ?", cleaned_tag_name.downcase).first_or_create!(
name: cleaned_tag_name,
)
@tag_mapping[row["id"]] = tag.id
if row["tag_group_id"]