diff --git a/app/models/user.rb b/app/models/user.rb index 9c437a186..b9d9de029 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -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 diff --git a/lib/tasks/sync_check_members.rake b/lib/tasks/sync_check_members.rake new file mode 100644 index 000000000..8c942c88c --- /dev/null +++ b/lib/tasks/sync_check_members.rake @@ -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