Commit ca63603d authored by Stan Hu's avatar Stan Hu

Fix "Can't modify frozen hash" error when project is destroyed

Partial fix to #44378
parent ea5221ae
...@@ -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