You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In #3322 we setup the opportunity attachment transformations when processing the attachments themselves, but need to also account for when the opportunity itself is updated (the below two scenarios).
Opportunity Update
If is_draft on an opportunity changes from True to False, we want to move all of the attachments to the public bucket. As opportunities get processed before attachments, we may move something and then later do another update, that is perfectly fine.
Opportunity delete
When we delete an ORM object, we automatically handle recursively deleting all the related models, but that wouldn’t cascade into s3. If an opportunity needs to be deleted, we want to first delete all of its attachments from s3, and then delete the opportunity.
Acceptance criteria
Logic updated
Tests added
The text was updated successfully, but these errors were encountered:
…ublished (#3503)
## Summary
Fixes#3500
### Time to review: __10 mins__
## Changes proposed
Handle the following two cases during the transformation process
* Opportunity deleted - clean up attachments from s3
* Opportunity stops being a draft - move all the attachments to the
other s3 bucket
## Context for reviewers
Mostly just some additional file utils for moving files to handle the
above scenarios. Only noteworthy callout is that there isn't really a
concept of "moving" a file on s3, it's just a copy+delete.
Summary
Summary
In #3322 we setup the opportunity attachment transformations when processing the attachments themselves, but need to also account for when the opportunity itself is updated (the below two scenarios).
Opportunity Update
If is_draft on an opportunity changes from True to False, we want to move all of the attachments to the public bucket. As opportunities get processed before attachments, we may move something and then later do another update, that is perfectly fine.
Opportunity delete
When we delete an ORM object, we automatically handle recursively deleting all the related models, but that wouldn’t cascade into s3. If an opportunity needs to be deleted, we want to first delete all of its attachments from s3, and then delete the opportunity.
Acceptance criteria
The text was updated successfully, but these errors were encountered: