定位gitlab日志

This commit is contained in:
huang 2018-09-30 17:47:16 +08:00
parent 26cc87ba84
commit a739561989
1 changed files with 3 additions and 0 deletions

View File

@ -21,6 +21,7 @@ module Trustie
def find_user(user)
us = self.g.get("/users?search=#{user.mail}")
Rails.logger.info("gitlab find user ########################{us.count}")
if Array === us
us.each do |u|
return u if u.email == user.mail
@ -38,11 +39,13 @@ module Trustie
if login.include?("@") || login.end_with?(".")
login = generate_username
end
Rails.logger.info("create gitlab user ########################{u.try(:id)}")
u = self.g.create_user(user.mail,
user.hashed_password,
name: user.show_name,
username: login,
confirm: "true")
Rails.logger.info("gitlab user is ########################{u.try(:id)}")
user.gid = u.id
user.save
end