Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2018-03-19 18:22:06 +0300
committerRobert Speicher <robert@gitlab.com>2018-03-19 18:22:06 +0300
commit27e9b8bf3a4af67dbca2caddc7f5f2674653e43c (patch)
treedd82d48482d810829ce970af01301c53004b6fb1 /app
parentc2fedd73358b31697c3393a607a960ebf60af961 (diff)
parentca63603d052808b7a5ab9b04acc611215e23a8c3 (diff)
Merge branch 'sh-fix-failure-project-destroy' into 'master'
Fix "Can't modify frozen hash" error when project is destroyed See merge request gitlab-org/gitlab-ce!17816
Diffstat (limited to 'app')
-rw-r--r--app/services/projects/destroy_service.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/services/projects/destroy_service.rb b/app/services/projects/destroy_service.rb
index 81972df9b3c..4b8f955ae69 100644
--- a/app/services/projects/destroy_service.rb
+++ b/app/services/projects/destroy_service.rb
@@ -88,7 +88,11 @@ module Projects
def attempt_rollback(project, message)
return unless project
- project.update_attributes(delete_error: message, pending_delete: false)
+ # It's possible that the project was destroyed, but some after_commit
+ # hook failed and caused us to end up here. A destroyed model will be a frozen hash,
+ # which cannot be altered.
+ project.update_attributes(delete_error: message, pending_delete: false) unless project.destroyed?
+
log_error("Deletion failed on #{project.full_path} with the following message: #{message}")
end