diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-02-05 14:47:50 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-02-05 14:47:50 +0400 |
commit | 70e3bffd95eb5736dd108e0836abaa85a2f1c742 (patch) | |
tree | effcda0ec2a1b5e8437740cfe848226abd3200a2 /app/workers | |
parent | 39e37677f291c344e25583916a1811a052e38db6 (diff) |
Fixed: post-receive, project remove, tests
Diffstat (limited to 'app/workers')
-rw-r--r-- | app/workers/post_receive.rb | 5 |
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 |