forked from Trustie/forgeplus
fixed import_user.xlsx, 创建时间
This commit is contained in:
parent
c8cb544fd7
commit
c367a89bb0
|
|
@ -15,6 +15,7 @@ namespace :import_user do
|
|||
phone = row[1]
|
||||
company_name = row[3]
|
||||
user_type = row[4].to_s =="0" ? 3 : 4
|
||||
created_on = row[5].to_s
|
||||
password = "abc11111111"
|
||||
user = User.new(nickname: row[2], login: username, mail: email, password: password, type: 'User', phone: phone, company_name: company_name)
|
||||
interactor = Gitea::RegisterInteractor.call({ username: username, email: email, password: password })
|
||||
|
|
@ -23,6 +24,8 @@ namespace :import_user do
|
|||
user.gitea_token = result['sha1']
|
||||
user.gitea_uid = gitea_user[:body]['id']
|
||||
user.user_type = user_type if company_name.present? && company_name.include?("大学")
|
||||
user.created_on = created_on if created_on.present?
|
||||
user.updated_on = created_on if created_on.present?
|
||||
user.save!
|
||||
UserExtension.create!(user_id: user.id)
|
||||
puts "import_user batch success: #{row[5]} username: #{row[0]}"
|
||||
|
|
|
|||
Loading…
Reference in New Issue