Update FileAttachment.objects.create_from_filediff to set needed fields.

Review Request #13532 — Created Feb. 12, 2024 and submitted — Latest diff uploaded

Information

Review Board
master

Reviewers

It turns out that having a FileAttachment for a diff that does not have
the review request set will cause the review UI instantiation to fail.
This change fixes the create_from_filediff method to set the review
request and local site fields correctly based on the given FileDiff's
review request.

  • Ran unit tests.
  • Used this when automatically creating a diff file attachment in a
    later change.

Changes between revision 1 and 2

orig
1
2
3

Commits

Summary ID Author
Update FileAttachment.objects.create_from_filediff to set needed fields.
It turns out that having a FileAttachment for a diff that does not have the review request set will cause the review UI instantiation to fail. This change fixes the `create_from_filediff` method to set the review request and local site fields correctly based on the given FileDiff's review request. Testing Done: - Ran unit tests. - Used this when automatically creating a diff file attachment in a later change.
8906fa362559a4e2659dabb912af4a1df87d2361 David Trowbridge
Update FileAttachment.objects.create_from_filediff to set needed fields.
It turns out that having a FileAttachment for a diff that does not have the review request set will cause the review UI instantiation to fail. This change fixes the `create_from_filediff` method to set the review request and local site fields correctly based on the given FileDiff's review request. Testing Done: - Ran unit tests. - Used this when automatically creating a diff file attachment in a later change.
bf4481c4c5909a1308757c840cc173ead17c30ee David Trowbridge
reviewboard/attachments/managers.py
Loading...