mirror of
https://github.com/discourse/discourse.git
synced 2025-01-30 16:33:59 +08:00
Use an invalid domain for fake email addresses in importers
This commit is contained in:
parent
d3ba338144
commit
c70d0c6659
|
@ -118,7 +118,7 @@ class ImportScripts::MyAskBot < ImportScripts::Base
|
|||
{
|
||||
id: user["id"],
|
||||
username: user["username"],
|
||||
email: user["email"] || (SecureRandom.hex << "@domain.com"),
|
||||
email: user["email"] || fake_email,
|
||||
admin: user["is_staff"],
|
||||
created_at: Time.zone.at(@td.decode(user["date_joined"])),
|
||||
last_seen_at: Time.zone.at(@td.decode(user["last_seen"])),
|
||||
|
|
|
@ -883,6 +883,6 @@ class ImportScripts::Base
|
|||
end
|
||||
|
||||
def fake_email
|
||||
SecureRandom.hex << "@domain.com"
|
||||
SecureRandom.hex << "@email.invalid"
|
||||
end
|
||||
end
|
||||
|
|
|
@ -139,7 +139,7 @@ class ImportScripts::Bespoke < ImportScripts::Base
|
|||
|
||||
# fake it
|
||||
if row.email.blank? || row.email !~ /@/
|
||||
email = SecureRandom.hex << "@domain.com"
|
||||
email = fake_email
|
||||
end
|
||||
|
||||
name = row.display_name
|
||||
|
|
|
@ -154,7 +154,7 @@ class ImportScripts::Jive < ImportScripts::Base
|
|||
|
||||
# fake it
|
||||
if row.email.blank? || row.email !~ /@/
|
||||
email = SecureRandom.hex << "@domain.com"
|
||||
email = fake_email
|
||||
end
|
||||
|
||||
name = "#{row.firstname} #{row.lastname}"
|
||||
|
|
|
@ -80,7 +80,7 @@ class ImportScripts::Nabble < ImportScripts::Base
|
|||
create_users(users, total: total_count, offset: offset) do |row|
|
||||
{
|
||||
id: row["user_id"],
|
||||
email: row["email"] || (SecureRandom.hex << "@domain.com"),
|
||||
email: row["email"] || fake_email,
|
||||
created_at: Time.zone.at(@td.decode(row["joined"])),
|
||||
name: row["name"],
|
||||
post_create_action: proc do |user|
|
||||
|
|
Loading…
Reference in New Issue
Block a user