Commit 27e9b8bf authored by Robert Speicher's avatar Robert Speicher

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
parents c2fedd73 ca63603d
...@@ -88,7 +88,11 @@ module Projects ...@@ -88,7 +88,11 @@ module Projects
def attempt_rollback(project, message) def attempt_rollback(project, message)
return unless project 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}") log_error("Deletion failed on #{project.full_path} with the following message: #{message}")
end end
......
---
title: Fix "Can't modify frozen hash" error when project is destroyed
merge_request:
author:
type: fixed
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment