• 
      

    Fix issue counter initialization with unopened issues containing states.

    Review Request #6384 — Created Sept. 30, 2014 and submitted

    Information

    Review Board
    release-2.0.x
    efa23e0...

    Reviewers

    It's possible for a Comment to have both issue_opened=False and
    issue_status=OPEN. We weren't checking for this during counter
    initialization, resulting in such comments being included in the count.

    The reason why they end up in this state is a separate issue that should
    be addressed, but it's certainly easy to work around. We now properly
    check the issue_opened field before even considering its issue_status.

    There's also a fix for transitioning an issue status when saving the
    Comment when issue_opened is False. This is needed for tests, primarily,
    but would probably also solve some issues that could come up in the API.

    The unit tests failed with the reported error conditions without the
    fixes to the counter initialization. After the fix, the tests all passed.

    reviewbot
    1. Tool: Pyflakes
      Processed Files:
          reviewboard/reviews/tests.py
          reviewboard/reviews/models/base_comment.py
          reviewboard/reviews/models/review_request.py
      
      
      
      Tool: PEP8 Style Checker
      Processed Files:
          reviewboard/reviews/tests.py
          reviewboard/reviews/models/base_comment.py
          reviewboard/reviews/models/review_request.py
      
      
    2. 
        
    david
    1. Ship It!

    2. 
        
    chipx86
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to release-2.0.x (76a2346)