Skip to content
Snippets Groups Projects
Commit ca63603d authored by Stan Hu's avatar Stan Hu
Browse files

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

Partial fix to #44378
parent ea5221ae
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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
 
Loading
Loading
---
title: Fix "Can't modify frozen hash" error when project is destroyed
merge_request:
author:
type: fixed
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment