Copy over draft information on an unpublished private review request discard

Review Request #6748 — Created Jan. 8, 2015 and submitted

Information

Review Board
master
bad1802...

Reviewers

If you create a new review request, fill out the description, testing done, etc. information, and then discard it without publishing, the information that you filled out will no longer be in the review request. With this fix, the draft information is copied over on private unpublished review requests.

  • All existing unit tests were run and passed.
  • Added two unit tests to check behaviour of discarding a private unpublished review request (this one should have the change description updated based on the request draft) and discarding a public unpublished review request (this should not have the change description updated and behaves like it used to).
  • Manually tested combinations of: filling out the information (description, testing done, file attachments) of a new review request, discarding it, reopening it, modifying/not modifying fields, and discarding it again.
Description From Last Updated

This can be replaced with one line, which will do a more efficient database query: latest_changedesc = \ review_request.changedescs.filter(public=True).latest()

daviddavid

This can be replaced with one line, which will do a more efficient database query: latest_changedesc = \ review_request.changedescs.filter(public=True).latest()

daviddavid
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/tests.py
        reviewboard/reviews/models/review_request_draft.py
        reviewboard/reviews/models/review_request.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/tests.py
        reviewboard/reviews/models/review_request_draft.py
        reviewboard/reviews/models/review_request.py
    
    
  2. 
      
david
  1. 
      
  2. reviewboard/reviews/tests.py (Diff revision 1)
     
     
     
     
     
     
     
    Show all issues

    This can be replaced with one line, which will do a more efficient database query:

    latest_changedesc = \
        review_request.changedescs.filter(public=True).latest()
    
  3. reviewboard/reviews/tests.py (Diff revision 1)
     
     
     
     
     
     
     
    Show all issues

    This can be replaced with one line, which will do a more efficient database query:

    latest_changedesc = \
        review_request.changedescs.filter(public=True).latest()
    
  4. 
      
JY
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/tests.py
        reviewboard/reviews/models/review_request_draft.py
        reviewboard/reviews/models/review_request.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/tests.py
        reviewboard/reviews/models/review_request_draft.py
        reviewboard/reviews/models/review_request.py
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
JY
Review request changed
Status:
Completed
Change Summary:
Pushed to release-2.0.x (243d1c6)