Fix using ?only-fields= on the user resource with private profiles.

Review Request #8683 — Created Jan. 30, 2017 and submitted

Information

Review Board
release-2.5.x
b9bee4c...

Reviewers

When serializing a user in the API who has private profiles enabled,
we'd try to remove some data from the resulting payload. However, if the
caller used ?only-fields= and didn't specify those fields, the
serialization process would crash. We now catch any errors here and
ignore them.

Unit tests were added to ensure this doesn't regress.

The new unit test failed before the fix, and passed after.

Description From Last Updated

Typo: thisa

daviddavid
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/webapi/resources/user.py
        reviewboard/webapi/tests/test_user.py
    
    
    
    Tool: Pyflakes
    Processed Files:
        reviewboard/webapi/resources/user.py
        reviewboard/webapi/tests/test_user.py
    
    
  2. 
      
david
  1. Thanks for fixing this!

  2. reviewboard/webapi/resources/user.py (Diff revision 1)
     
     
    Show all issues

    Typo: thisa

  3. 
      
brennie
  1. LGTM, pending David's issue.

  2. 
      
chipx86
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/webapi/resources/user.py
        reviewboard/webapi/tests/test_user.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/webapi/resources/user.py
        reviewboard/webapi/tests/test_user.py
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-2.5.x (8594669)
Loading...