From 37a79409d446955eeb443ea5397d5bf263601a2d Mon Sep 17 00:00:00 2001 From: Toon Claes Date: Tue, 9 May 2017 22:16:52 +0200 Subject: No user needed to cleanup namespaceless pending delete projects Since this is a cleanup, ran by a post-deploy, there is no need to lookup the admin to run the cleanup. --- app/workers/namespaceless_project_destroy_worker.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'app/workers') diff --git a/app/workers/namespaceless_project_destroy_worker.rb b/app/workers/namespaceless_project_destroy_worker.rb index da02084c688..bfae0c77700 100644 --- a/app/workers/namespaceless_project_destroy_worker.rb +++ b/app/workers/namespaceless_project_destroy_worker.rb @@ -12,7 +12,7 @@ class NamespacelessProjectDestroyWorker Sidekiq::Client.push_bulk('class' => self, 'queue' => sidekiq_options['queue'], 'args' => args_list) end - def perform(project_id, user_id, params) + def perform(project_id) begin project = Project.unscoped.find(project_id) rescue ActiveRecord::RecordNotFound @@ -20,9 +20,6 @@ class NamespacelessProjectDestroyWorker end return unless project.namespace_id.nil? # Reject doing anything for projects that *do* have a namespace - user = User.find(user_id) - return unless user.can?(:remove_project, project) - project.team.truncate unlink_fork(project) if project.forked? -- cgit v1.2.1