实训任务查询是否有username错误

This commit is contained in:
huang 2018-06-13 14:39:58 +08:00
parent 6112c13b34
commit 2ff7c1f42b
1 changed files with 12 additions and 0 deletions

View File

@ -41,6 +41,18 @@ namespace :gitlab do
end
end
task :username => :environment do
# projects = Project.where(:id => [6286, 6292, 6293, 6294])
users = User.where("gid is not null")
g = Gitlab.client
# users = User.where(:gid => 8823)
users.each do |user|
if g.user(user.gid).try(:username) != user.login
puts "start"+ "#{user.id}"
end
end
end
desc "update user password"
task :password => :environment do
s = Trustie::Gitlab::Sync.new