v0.16.4 Profile image handling improvement
This commit is contained in:
parent
c384aebed5
commit
04bca84117
@ -1,5 +1,5 @@
|
|||||||
# gossamer threads migration-import code
|
# gossamer threads migration-import code
|
||||||
# v0.16.3
|
# v0.16.4
|
||||||
|
|
||||||
require 'mysql2'
|
require 'mysql2'
|
||||||
require 'open-uri'
|
require 'open-uri'
|
||||||
@ -501,11 +501,14 @@ class GossamerForumsImporter < ImportScripts::Base
|
|||||||
|
|
||||||
puts "#E"
|
puts "#E"
|
||||||
|
|
||||||
# Append the image to the user's bio
|
# Append the image to the user's bio_raw only if it does not already exist
|
||||||
user.user_profile.bio_raw ||= ""
|
image_markdown = "\n\n![#{file['File_Name']}](#{file_url})"
|
||||||
user.user_profile.bio_raw += "\n\n![#{file['File_Name']}](#{file_url})"
|
user.user_profile.bio_raw ||= ""
|
||||||
user.user_profile.save!
|
unless user.user_profile.bio_raw.include?(image_markdown)
|
||||||
|
user.user_profile.bio_raw += image_markdown
|
||||||
|
user.user_profile.save!
|
||||||
|
end
|
||||||
|
|
||||||
# Clean up temporary files
|
# Clean up temporary files
|
||||||
temp_file.close
|
temp_file.close
|
||||||
temp_file.unlink
|
temp_file.unlink
|
||||||
|
Loading…
Reference in New Issue
Block a user