Fix 500 errors when two review requests depend on each other.

Review Request #7643 — Created Sept. 18, 2015 and submitted

Information

Review Board
release-2.0.x
b9775b7...

Reviewers

If two review requests are marked as depending on each other, serializing
things to the API would fail due to the circular reference. The issue here is
that the draft model on the frontend was requesting that the depends on field
be expanded.

The only reason it was needing to be expanded was because it wanted to get the
"url" field. Since we already had custom serializers for the links in the
review request model, I've extended these a bit to add the URL field (and
copied them to the draft resource), so we don't need to fetch the fully
expanded dependency object.

Set two review requests to depend on each other. Verified that I could now make
changes to the drafts without getting 500 errors.

Description From Last Updated

You can do link.id and link.url, which will make jshint happier. Same below.

chipx86chipx86
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/webapi/resources/review_request_draft.py
        reviewboard/webapi/resources/review_request.py
    
    Ignored Files:
        reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/webapi/resources/review_request_draft.py
        reviewboard/webapi/resources/review_request.py
    
    Ignored Files:
        reviewboard/static/rb/js/resources/models/draftReviewRequestModel.js
    
    
  2. 
      
chipx86
  1. 
      
  2. Show all issues

    You can do link.id and link.url, which will make jshint happier.

    Same below.

    1. ... This is not JavaScript. Nevermind!

  3. 
      
chipx86
  1. Ship It!
  2. 
      
david
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-2.0.x (9b7fd12)
Loading...