Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-02-05 14:47:50 +0400
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-02-05 14:47:50 +0400
commit70e3bffd95eb5736dd108e0836abaa85a2f1c742 (patch)
treeeffcda0ec2a1b5e8437740cfe848226abd3200a2 /app/workers
parent39e37677f291c344e25583916a1811a052e38db6 (diff)
Fixed: post-receive, project remove, tests
Diffstat (limited to 'app/workers')
-rw-r--r--app/workers/post_receive.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/workers/post_receive.rb b/app/workers/post_receive.rb
index 17ccfae21ec..6e2d0e7aba2 100644
--- a/app/workers/post_receive.rb
+++ b/app/workers/post_receive.rb
@@ -27,8 +27,9 @@ class PostReceive
User.find_by_email(email) if email
elsif /^[A-Z0-9._%a-z\-]+@(?:[A-Z0-9a-z\-]+\.)+[A-Za-z]{2,4}$/.match(identifier)
User.find_by_email(identifier)
- else
- User.find_by_username(identifier.strip)
+ elsif identifier =~ /key/
+ key_id = identifier.gsub("key-", "")
+ Key.find_by_id(key_id).try(:user)
end
unless user