Don't share the extra_data instance between a review request and draft.
Review Request #6813 — Created Jan. 19, 2015 and submitted
When creating a draft from a review request, the
extra_datainstance was
being assigned to the draft, instead of being copied over. This meant
that if any code tried to write into the draft'sextra_data, it would
also appear in the review request's.This was first noticed when attempting to do an API POST to the draft
resource that both changed anextra_datafield on the draft and
published in one go. The publish code thought that the data hadn't been
changed, since it was in the sharedextra_data, and would complain.We now do a
deepcopyofextra_datato prevent any sharing issues.
Added a new unit test that failed with the old behavior. It now passes.
All other unit tests pass too.
Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/models/review_request_draft.py reviewboard/webapi/tests/test_review_request_draft.py Tool: Pyflakes Processed Files: reviewboard/reviews/models/review_request_draft.py reviewboard/webapi/tests/test_review_request_draft.py