Feature/redbox 234 keep deleted file django reference #448
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
After discussion with the wider product team about managing deleted documents, we decided to keep a reference to files in the Django database when the files were deleted from S3 and the core_api.
Changes proposed in this pull request
Now when a user chooses to delete an object, we delete the file from S3 rather than the whole Django object.
This also updates the UI with an interim version to show that the file is in a 'deleted' state.
![Screenshot 2024-05-23 at 15 48 12](https://private-user-images.githubusercontent.com/23265724/333235997-1826cfda-6451-49e6-8b13-12b84037ebf1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1NjY2MTMsIm5iZiI6MTczOTU2NjMxMywicGF0aCI6Ii8yMzI2NTcyNC8zMzMyMzU5OTctMTgyNmNmZGEtNjQ1MS00OWU2LThiMTMtMTJiODQwMzdlYmYxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE0VDIwNTE1M1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTBjZjVhZDJhNzYxN2ZiMDBkMWQ3NDk5YmZjZjU2NWVjZTkwNDk1NDFkNmJkNjg1NzQ0OWI2ZGZiZThhYzgzOTAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.9bJmvBTQMykVcVGdNU-hMR-VP6RBbcX1PCiXSqiK-BI)
Guidance to review
Run locally, including the database migrations (check nothing broken) - you might need to
make reset-db
before switching to a different branch. Try deleting a file and check how it displays - see if it deleted in minio.Relevant links
https://technologyprogramme.atlassian.net/browse/REDBOX-234
Things to check
[ ] I have added any new ENV vars in all deployed environments[ ] I have run integration tests