• 
      

    Fix missing data for file attachment thumbnails for change descriptions.

    Review Request #8232 — Created June 10, 2016 and submitted

    Information

    Review Board
    release-2.5.x
    d6213ed...

    Reviewers

    If a file attachment thumbnail needed to make use of the User currently
    browsing the page, it could break when rendering change descriptions, as
    the request variable wasn't being provided to the template context.
    The implementation would only see an empty string. This was causing
    problems with Power Pack's PDF thumbnail support.
    
    We now simply ensure that the request is passed in as part of the
    context.

    Tested against a PDF thumbnail on a change description. I didn't see any
    errors.

    Had a customer test this as well, and he verified the errors went away on
    his end.

    Description From Last Updated

    Wouldn't it be better to make this a RequestContext?

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

      Wouldn't it be better to make this a RequestContext?

      1. RequestContext is great when you really need the template to have access to not only the request but any context processors that are registered. However, it's pretty slow, as it results in a lot of extra processing up-front, both internally to the class and by invoking all the context processors. Since we have a very limited template here (it's baked into Review Board, and not something overridden by extensions), we don't need to deal with all that extra processing.

      2. Sounds good.

    3. 
        
    david
    1. Ship It!
    2. 
        
    chipx86
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to release-2.5.x (441ab30)