Do not attempt to render uninstantiated fields

Review Request #7787 — Created Dec. 1, 2015 and submitted

Information

Review Board
release-2.5.x
04ba860...

Reviewers

Previously, an error in instantiating a ReviewRequestField would
lead to an error being logged, but the field would still be attempted to
be rendered. Since the instantiation failed, the variable would be
uninitialized leading to an UnboundLocalError.

Now, if the field cannot be insantiated, we skip to the next field in
the fieldset.

Ran unit tests.

Description From Last Updated

Col: 1 E302 expected 2 blank lines, found 1

reviewbotreviewbot

You can use logging.exception instead, and skip the exc_info=1.

chipx86chipx86

Swap these.

chipx86chipx86

Missing a period.

chipx86chipx86

No need for parens.

chipx86chipx86

This will fail if the above raises an exception, since result won't be defined.

chipx86chipx86

Can we verify the results of this, in case we ever get another logging call and somehow miss the intended …

chipx86chipx86

'six' imported but unused

reviewbotreviewbot
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/templatetags/tests.py
        reviewboard/reviews/templatetags/reviewtags.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/templatetags/tests.py
        reviewboard/reviews/templatetags/reviewtags.py
    
    
  2. Show all issues
    Col: 1
     E302 expected 2 blank lines, found 1
    
  3. 
      
brennie
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/templatetags/tests.py
        reviewboard/reviews/templatetags/reviewtags.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/templatetags/tests.py
        reviewboard/reviews/templatetags/reviewtags.py
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
chipx86
  1. 
      
  2. Show all issues

    You can use logging.exception instead, and skip the exc_info=1.

  3. reviewboard/reviews/templatetags/tests.py (Diff revision 2)
     
     
     
    Show all issues

    Swap these.

  4. Show all issues

    Missing a period.

  5. Show all issues

    No need for parens.

  6. Show all issues

    This will fail if the above raises an exception, since result won't be defined.

  7. Show all issues

    Can we verify the results of this, in case we ever get another logging call and somehow miss the intended one?

  8. 
      
brennie
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/templatetags/tests.py
        reviewboard/reviews/templatetags/reviewtags.py
    
    
    
    Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/templatetags/tests.py
        reviewboard/reviews/templatetags/reviewtags.py
    
    
  2. Show all issues
     'six' imported but unused
    
  3. 
      
brennie
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/templatetags/tests.py
        reviewboard/reviews/templatetags/reviewtags.py
    
    
    
    Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/templatetags/tests.py
        reviewboard/reviews/templatetags/reviewtags.py
    
    
  2. 
      
brennie
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/templatetags/tests.py
        reviewboard/reviews/templatetags/reviewtags.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/templatetags/tests.py
        reviewboard/reviews/templatetags/reviewtags.py
    
    
  2. 
      
chipx86
  1. Ship It!
  2. 
      
brennie
Review request changed
Status:
Completed
Change Summary:
Pushed to release-2.5.x (c12a17e)