parent
f2f81d5243
commit
f2c1595d0d
|
@ -226,7 +226,7 @@ class User < Principal
|
|||
validates_uniqueness_of :login, :if => Proc.new { |user| user.login_changed? && user.login.present? }, :case_sensitive => false
|
||||
validates_uniqueness_of :mail, :if => Proc.new { |user| user.mail_changed? && user.mail.present? }, :case_sensitive => false
|
||||
# Login must contain letters, numbers, underscores only
|
||||
validates_format_of :login, :with => /\A[a-z0-9_\-@\.]*\z/i
|
||||
validates_format_of :login, :with => /\A[a-z0-9_\-\.]*\z/i
|
||||
validates_length_of :login, :maximum => LOGIN_LENGTH_LIMIT
|
||||
validates_length_of :firstname, :maximum => 30
|
||||
validates_length_of :lastname, :maximum => 30
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
require 'trustie/gitlab/sync'
|
||||
|
||||
namespace :gitlab do
|
||||
namespace :check_members do
|
||||
desc "check up projects' members "
|
||||
task :projects => :environment do
|
||||
s = Trustie::Gitlab::Sync.new
|
||||
g = Gitlab.client
|
||||
Project.all.each do |project|
|
||||
unless project.gpid.nil?
|
||||
begin
|
||||
gmembers = g.team_members(project.gpid)
|
||||
if gmembers.count != project.members.count
|
||||
puts "gitlab' projects count #{gmembers.count}"
|
||||
puts "project ID is #{project.id}"
|
||||
s.only_members(project)
|
||||
end
|
||||
rescue
|
||||
p "This project is wrong #{project.id}"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue