导入gitee issue,用户名太长

This commit is contained in:
xxq250 2023-03-22 18:24:42 +08:00
parent cddbf2a7cc
commit ec85b80a98
1 changed files with 2 additions and 1 deletions

View File

@ -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"