mirror of
https://github.com/discourse/discourse.git
synced 2025-02-16 18:24:52 -06:00
DEV: Don't import year of birth (#15937)
The cakeday plugin doesn't use the year.
This commit is contained in:
parent
f078d1ab0a
commit
33d6ed60a4
@ -431,6 +431,11 @@ class BulkImport::Base
|
|||||||
user[:last_emailed_at] ||= NOW
|
user[:last_emailed_at] ||= NOW
|
||||||
user[:created_at] ||= NOW
|
user[:created_at] ||= NOW
|
||||||
user[:updated_at] ||= user[:created_at]
|
user[:updated_at] ||= user[:created_at]
|
||||||
|
|
||||||
|
if (date_of_birth = user[:date_of_birth]).is_a?(Date) && date_of_birth.year != 1904
|
||||||
|
user[:date_of_birth] = Date.new(1904, date_of_birth.month, date_of_birth.day)
|
||||||
|
end
|
||||||
|
|
||||||
user
|
user
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -332,6 +332,10 @@ class ImportScripts::Base
|
|||||||
opts[:import_mode] = true
|
opts[:import_mode] = true
|
||||||
opts[:last_emailed_at] = opts.fetch(:last_emailed_at, Time.now)
|
opts[:last_emailed_at] = opts.fetch(:last_emailed_at, Time.now)
|
||||||
|
|
||||||
|
if (date_of_birth = opts[:date_of_birth]).is_a?(Date) && date_of_birth.year != 1904
|
||||||
|
opts[:date_of_birth] = Date.new(1904, date_of_birth.month, date_of_birth.day)
|
||||||
|
end
|
||||||
|
|
||||||
u = User.new(opts)
|
u = User.new(opts)
|
||||||
(opts[:custom_fields] || {}).each { |k, v| u.custom_fields[k] = v }
|
(opts[:custom_fields] || {}).each { |k, v| u.custom_fields[k] = v }
|
||||||
u.custom_fields["import_id"] = import_id
|
u.custom_fields["import_id"] = import_id
|
||||||
|
Loading…
Reference in New Issue
Block a user