mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -05:00
use first part of email address as username in SFN import
This commit is contained in:
parent
8c28838488
commit
5329403a71
1 changed files with 8 additions and 7 deletions
|
@ -40,7 +40,7 @@ class ImportScripts::Sfn < ImportScripts::Base
|
||||||
|
|
||||||
@external_users = {}
|
@external_users = {}
|
||||||
|
|
||||||
CSV.foreach("/Users/zogstrip/Downloads/sfn.csv", col_sep: ";") do |row|
|
CSV.foreach("/Users/zogstrip/Desktop/sfn.csv", col_sep: ";") do |row|
|
||||||
next unless @personify_id_to_contact_key.include?(row[0])
|
next unless @personify_id_to_contact_key.include?(row[0])
|
||||||
|
|
||||||
id = @personify_id_to_contact_key[row[0]]
|
id = @personify_id_to_contact_key[row[0]]
|
||||||
|
@ -90,6 +90,7 @@ class ImportScripts::Sfn < ImportScripts::Base
|
||||||
id: user["id"],
|
id: user["id"],
|
||||||
email: email,
|
email: email,
|
||||||
name: full_name,
|
name: full_name,
|
||||||
|
username: email.split("@")[0],
|
||||||
bio_raw: bio,
|
bio_raw: bio,
|
||||||
created_at: user["created_at"],
|
created_at: user["created_at"],
|
||||||
post_create_action: proc do |newuser|
|
post_create_action: proc do |newuser|
|
||||||
|
@ -191,13 +192,13 @@ class ImportScripts::Sfn < ImportScripts::Base
|
||||||
"{9613BAC2-229B-4563-9E1C-35C31CDDCE2F}" => 49, # "Students",
|
"{9613BAC2-229B-4563-9E1C-35C31CDDCE2F}" => 49, # "Students",
|
||||||
}
|
}
|
||||||
|
|
||||||
# def import_categories
|
def import_categories
|
||||||
# puts "", "importing categories..."
|
puts "", "importing categories..."
|
||||||
|
|
||||||
# create_categories(NEW_CATEGORIES) do |category|
|
create_categories(NEW_CATEGORIES) do |category|
|
||||||
# { id: category, name: category }
|
{ id: category, name: category }
|
||||||
# end
|
end
|
||||||
# end
|
end
|
||||||
|
|
||||||
def import_topics
|
def import_topics
|
||||||
puts "", "importing topics..."
|
puts "", "importing topics..."
|
||||||
|
|
Loading…
Reference in a new issue