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 | |
parent | 39e37677f291c344e25583916a1811a052e38db6 (diff) |
Fixed: post-receive, project remove, tests
Diffstat (limited to 'app')
-rw-r--r-- | app/observers/project_observer.rb | 3 | ||||
-rw-r--r-- | app/workers/post_receive.rb | 5 |
2 files changed, 4 insertions, 4 deletions
diff --git a/app/observers/project_observer.rb b/app/observers/project_observer.rb index 32004503fbf..cc2a0224b72 100644 --- a/app/observers/project_observer.rb +++ b/app/observers/project_observer.rb @@ -15,11 +15,10 @@ class ProjectObserver < ActiveRecord::Observer def after_destroy(project) GitoliteWorker.perform_async( :remove_repository, - self.path_with_namespace + project.path_with_namespace ) project.satellite.destroy - project.destroy_repository log_info("Project \"#{project.name}\" was removed") end 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 |