Bullet-proof change descriptions with deleted file attachments.

Review Request #6563 — Created Nov. 6, 2014 and submitted

Information

Review Board
release-2.0.x
99ef216...

Reviewers

Because of the ways that file attachments and change descriptions are stored,
it's possible to delete a file attachment from the database but still have its
old pk referenced from the change description. In this case, trying to render
that change description would crash because it no longer exists.

This change adds some bullet-proofing to ensure that we don't show a traceback.

Ran unit tests.

Description From Last Updated

In this particular failure case we're dealing with, it's now sounding more like the file exists but is no longer …

chipx86chipx86
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/builtin_fields.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/builtin_fields.py
    
    
  2. 
      
chipx86
  1. 
      
  2. reviewboard/reviews/builtin_fields.py (Diff revision 1)
     
     
     
     
     
     
     
     
     
    Show all issues

    In this particular failure case we're dealing with, it's now sounding more like the file exists but is no longer associated with the review request in any way. Can we have this conditionally check for the value in the map, and if it's missing, attempt a query for that object, then skip only if that doesn't exist?

  3. 
      
david
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/builtin_fields.py
    
    
    
    Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/builtin_fields.py
    
    
  2. 
      
chipx86
  1. Ship It!

  2. 
      
david
Review request changed
Status:
Completed
Change Summary:
Pushed to release-2.0.x (7aab073)