Fix project deletion when there is a export available
Project deletions were failing with "Can't modify frozen hash" because: 1. Project#remove_exports was called in the after_destroy hook 2. This would remove the file and update ImportExportUpload 3. ImportExportUpload#save would attempt to write to a destroyed model To avoid this, we just check if ImportExportUpload has been destroyed before attempting to save it. This would have a side effect of not running after_commit hooks to delete the repository on disk, making it impossible to delete the project entirely. Closes #52362
显示
- app/models/project.rb 1 个添加, 1 个删除app/models/project.rb
- changelogs/unreleased/sh-fix-project-deletion-with-export.yml 5 个添加, 0 个删除...gelogs/unreleased/sh-fix-project-deletion-with-export.yml
- spec/services/projects/destroy_service_spec.rb 20 个添加, 3 个删除spec/services/projects/destroy_service_spec.rb
加载中
想要评论请 注册 或 登录