v0.16.3 Profile image handling improvement

This commit is contained in:
David Sainty 2024-06-27 15:15:12 +10:00
parent b38e2853bb
commit c384aebed5

View File

@ -1,5 +1,5 @@
# gossamer threads migration-import code # gossamer threads migration-import code
# v0.16.2 # v0.16.3
require 'mysql2' require 'mysql2'
require 'open-uri' require 'open-uri'
@ -480,7 +480,8 @@ class GossamerForumsImporter < ImportScripts::Base
next if resized_upload.nil? next if resized_upload.nil?
# Ensure the upload ID is valid and exists # Ensure the upload ID is valid and exists
if resized_upload && UserAvatar.exists?(custom_upload_id: resized_upload.id) if resized_upload
# && UserAvatar.exists?(custom_upload_id: resized_upload.id)
# Set the avatar using the resized image # Set the avatar using the resized image
user.user_avatar = UserAvatar.create!(user_id: user.id, custom_upload_id: resized_upload.id) user.user_avatar = UserAvatar.create!(user_id: user.id, custom_upload_id: resized_upload.id)
user.save! user.save!