导入gitee issue,用户名太长
This commit is contained in:
parent
cddbf2a7cc
commit
ec85b80a98
|
@ -46,11 +46,12 @@ namespace :batch_add_issues do
|
|||
issue_status = ["", "open", "progressing", "", "", "closed", "rejected"].index(issue['state'])
|
||||
issue_status = 1 if issue_status.nil?
|
||||
user_login = issue['user']['login']
|
||||
user_login = user_login[0..20] if user_login.size > 29
|
||||
issue_created_at = issue['created_at']
|
||||
issue_updated_at = issue['updated_at']
|
||||
user = User.find_by(login: user_login)
|
||||
unless user.present?
|
||||
username = user_login[0..28]
|
||||
username = user_login
|
||||
email = "#{username}@gitlink.org.cn"
|
||||
phone = ""
|
||||
password = "a12345678"
|
||||
|
|
Loading…
Reference in New Issue