diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-03-24 14:53:30 +0100 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-03-27 11:09:29 +0100 |
commit | 3f7531d6f2974ea75ab8e67bc93049f674ddb672 (patch) | |
tree | 5340386a05e4970e7064392741c18f053157fccc /app/models/user.rb | |
parent | 28592ae46767443dc0f3723bd4f05f360bab8f41 (diff) | |
download | gitlab-ce-3f7531d6f2974ea75ab8e67bc93049f674ddb672.tar.gz |
Move User.cleanup_username to Namespace.cleanup_path.
Diffstat (limited to 'app/models/user.rb')
-rw-r--r-- | app/models/user.rb | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index 979150b4d68..3f3a8394d1f 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -229,22 +229,6 @@ class User < ActiveRecord::Base def build_user(attrs = {}) User.new(attrs) end - - def clean_username(username) - username.gsub!(/@.*\z/, "") - username.gsub!(/\.git\z/, "") - username.gsub!(/\A-/, "") - username.gsub!(/[^a-zA-Z0-9_\-\.]/, "") - - counter = 0 - base = username - while User.by_login(username).present? || Namespace.by_path(username).present? - counter += 1 - username = "#{base}#{counter}" - end - - username - end end # |