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_data
instance 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_data
field 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
deepcopy
ofextra_data
to prevent any sharing issues.
Added a new unit test that failed with the old behavior. It now passes.
All other unit tests pass too.