定位gitlab日志
This commit is contained in:
parent
26cc87ba84
commit
a739561989
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue