Cache a file attachment's review request on creation.
Review Request #15175 — Created July 17, 2026 and updated
As mentioned in /r/15164, the M2M field for file attachments and
their review request only gets set after the attachment's first save.
However, it would be useful to access the review request of a file
attachment before the first save. File attachments already made use of
a cached_review_requestinstance variable that we would set in
BaseReviewRequestDetails.get_file_attachments(). This change similarly
sets the attribute when a file attachment is created, since we have the
review request already. This also improves
FileAttachment.get_review_request()to set the cached instance if not
already set when its called.
- Ran unit tests.
- Used in a change where we call
attachment.get_review_request()in a
file attachment post-save signal handler upon the first save, saw the
cached instance was used.