Allow inactive users to be fetched from the API

Review Request #8667 — Created Jan. 26, 2017 and submitted

Information

Review Board
release-2.5.x
39bab3c...

Reviewers

Previously attempting to retrieve a user from the API who had been set
to inactive would result in a 404 Not Found, which was an issue for any
review requests or reviews they had created (as the link included would
not work). Now we return a user from the /api/users/<username>/ API
regardless of whether or not they are active. However, we still filter
out users from the /api/users/ API unless include-inactive=1 is
provided as a GET parameter to the request.

Ran unit tests.

Description From Last Updated

Oh, one small typo in your description: /api/user/<username>/ should be /api/users/<username>/

daviddavid

Missing a trailing period. I'd also maybe have this maybe clarify in some form that active means the account is …

chipx86chipx86

Instead of this query, let's use a queryset that checks against is_active.

chipx86chipx86

Same here.

chipx86chipx86

Set literals are only available in Python 2.7, but this change is on release-2.5.x. We should just make this a …

daviddavid

Set literals are only available in Python 2.7, but this change is on release-2.5.x. We should just make this a …

daviddavid
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. 
      
chipx86
  1. 
      
  2. reviewboard/webapi/resources/user.py (Diff revision 1)
     
     
    Show all issues

    Missing a trailing period.

    I'd also maybe have this maybe clarify in some form that active means the account is enabled. It's kind of odd terminology.

  3. reviewboard/webapi/tests/test_user.py (Diff revision 1)
     
     
    Show all issues

    Instead of this query, let's use a queryset that checks against is_active.

  4. reviewboard/webapi/tests/test_user.py (Diff revision 1)
     
     
    Show all issues

    Same here.

  5. 
      
brennie
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. 
      
  2. reviewboard/webapi/tests/test_user.py (Diff revision 2)
     
     
    Show all issues

    Set literals are only available in Python 2.7, but this change is on release-2.5.x. We should just make this a list.

  3. reviewboard/webapi/tests/test_user.py (Diff revision 2)
     
     
    Show all issues

    Set literals are only available in Python 2.7, but this change is on release-2.5.x. We should just make this a list.

  4. 
      
brennie
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. 
      
david
  1. 
      
  2. Show all issues

    Oh, one small typo in your description: /api/user/<username>/ should be /api/users/<username>/

  3. 
      
brennie
brennie
Review request changed
Status:
Completed
Change Summary:
Pushed to release-2.5.x (9bed605)