diff options
author | Stan Hu <stanhu@gmail.com> | 2017-02-19 16:00:27 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2017-02-19 16:00:27 +0300 |
commit | 45f94ea78cf85a58e71e9a8ae62adc7e3f86bc99 (patch) | |
tree | d1e1ce1bb52ca2324f5a40ed5d8322d57ce2b45c /app/services | |
parent | 12cd4c83604e43dc308ba13fa3d5a6571409c1f8 (diff) |
Prevent project team from being truncated too early during project destruction
There are two issues with truncating the project team early:
1. `Projects::UnlinkForkService` may not close merge requests properly since
permissions may be revoked early.
2. If an error is encountered during flushing of caches, then the user will
lose all privileges, possibly causing an issue on deletion on retry.
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/projects/destroy_service.rb | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/app/services/projects/destroy_service.rb b/app/services/projects/destroy_service.rb index a08c6fcd94b..9716a1780a9 100644 --- a/app/services/projects/destroy_service.rb +++ b/app/services/projects/destroy_service.rb @@ -17,8 +17,6 @@ module Projects def execute return false unless can?(current_user, :remove_project, project) - project.team.truncate - repo_path = project.path_with_namespace wiki_path = repo_path + '.wiki' @@ -30,6 +28,7 @@ module Projects Projects::UnlinkForkService.new(project, current_user).execute Project.transaction do + project.team.truncate project.destroy! unless remove_registry_tags |