Get rid of skipping callbacks in production code. Dont trigger gitolite more than once on import in group
This commit is contained in:
parent
151ada7645
commit
e37a043df7
7 changed files with 72 additions and 56 deletions
|
@ -99,11 +99,10 @@ class ProjectsController < ProjectResourceController
|
|||
def destroy
|
||||
return access_denied! unless can?(current_user, :remove_project, project)
|
||||
|
||||
# Disable the UsersProject update_repository call, otherwise it will be
|
||||
# called once for every person removed from the project
|
||||
UsersProject.skip_callback(:destroy, :after, :update_repository)
|
||||
# Delete team first in order to prevent multiple gitolite calls
|
||||
project.truncate_team
|
||||
|
||||
project.destroy
|
||||
UsersProject.set_callback(:destroy, :after, :update_repository)
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to root_path }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue