Remove an unnecessary save in the file attachment resources.

Review Request #13452 — Created Dec. 7, 2023 and submitted — Latest diff uploaded

Information

Review Board
release-6.x

Reviewers

The file attachment resources were unconditionally saving the file
attachment's extra_data, causing a write when one otherwise wouldn't
occur.

This happened because we weren't checking the result of
import_extra_data(), assuming we always had to save the results. We
now only do this if we know a change was made.

Unit tests pass.

Diff Revision 1 (Latest)

Commits

First Last Summary ID Author
Remove an unnecessary save in the file attachment resources.
The file attachment resources were unconditionally saving the file attachment's extra_data, causing a write when one otherwise wouldn't occur. This happened because we weren't checking the result of `import_extra_data()`, assuming we always had to save the results. We now only do this if we know a change was made.
3a187b6bc348f557c9eacd90ad3120fc1d93d15f Christian Hammond
reviewboard/webapi/resources/base_review_request_file_attachment.py
reviewboard/webapi/tests/test_file_attachment.py
reviewboard/webapi/tests/test_file_attachment_draft.py
Loading...