Fix expanding resources in list resource APIs.

Review Request #7115 — Created March 25, 2015 and submitted

Information

Djblets
release-0.8.x
f3a207c...

Reviewers

Some time ago, in order to prevent an infinite loop with expanding some
resources, we started removing any expanded resource keys we found from
the expansion list.

This posed a problem for list resources. The first item listed would
have expansions applied, but subsequent items would not. This made
expansion terribly unreliable when working with lists.

We now save this list before we start altering it, and restore it once
we've finished serializing an object. Any nested objects being
serialized will operate off the altered expansion list, and not the
original in the request.

Unit tests pass.

I was hitting this with a change, and the problem went away. Verified all
resources in a list properly expanded the expected keys.

Description From Last Updated

Col: 9 E303 too many blank lines (2)

reviewbotreviewbot
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        djblets/webapi/resources.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        djblets/webapi/resources.py
    
    
  2. djblets/webapi/resources.py (Diff revision 1)
     
     
    Show all issues
    Col: 9
     E303 too many blank lines (2)
    
  3. 
      
chipx86
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        djblets/webapi/resources.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        djblets/webapi/resources.py
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-0.8.x (d458937)