• 
      

    Drag 'n Drop Inline Images Backend - View

    Review Request #6616 — Created Nov. 21, 2014 and submitted

    Information

    Review Board
    master

    Reviewers

    Part of a set of changes to add support for dragging and dropping images into the markdown editor.

    Adding a view that redirects to a FileAttachment's file. Adding a uuid field to the FileAttachment model, to be used by the view as non-guessable identifier for the FileAttachment.
    This view can be accessed at the following url: /users/<username>/file-attachments/<uuid>/

    All unit tests pass after making the changes.

    Did some manual testing to make sure the view properly redirects to the file, and the file can be viewed.

    Description From Last Updated

    Since this is a "view", the view_ prefix seems superfluous - maybe just call this user_file_attachment.

    mike_conleymike_conley

    Isn't the user already available at request.user?

    mike_conleymike_conley

    We're using single quotes throughout the rest of this file - might as well stick with the convention. Same applies …

    mike_conleymike_conley

    Why the double $?

    mike_conleymike_conley

    Might as well just be "user-file-attachment"

    mike_conleymike_conley

    "URL", "UUID", and "a its" -> "its".

    chipx86chipx86
    reviewbot
    1. Tool: PEP8 Style Checker
      Processed Files:
          reviewboard/attachments/evolutions/file_attachment_uuid.py
          reviewboard/attachments/evolutions/__init__.py
          reviewboard/attachments/views.py
          reviewboard/attachments/models.py
          reviewboard/urls.py
      
      
      
      Tool: Pyflakes
      Processed Files:
          reviewboard/attachments/evolutions/file_attachment_uuid.py
          reviewboard/attachments/evolutions/__init__.py
          reviewboard/attachments/views.py
          reviewboard/attachments/models.py
          reviewboard/urls.py
      
      
    2. 
        
    dkus
    mike_conley
    1. 
        
    2. reviewboard/attachments/views.py (Diff revision 1)
       
       
      Show all issues

      Since this is a "view", the view_ prefix seems superfluous - maybe just call this user_file_attachment.

    3. reviewboard/attachments/views.py (Diff revision 1)
       
       
      Show all issues

      Isn't the user already available at request.user?

      1. Isn't request.user the requesting user? That's not what I want to get here, I want to get the user specified in the url, which may not be the requesting user.

      2. Yep, you're absolutely right.

    4. reviewboard/urls.py (Diff revision 1)
       
       
      Show all issues

      We're using single quotes throughout the rest of this file - might as well stick with the convention. Same applies with the rest of your changes in here.

    5. reviewboard/urls.py (Diff revision 1)
       
       
      Show all issues

      Why the double $?

      1. Oops, did some refactoring here and didn't notice.

    6. reviewboard/urls.py (Diff revision 1)
       
       
      Show all issues

      Might as well just be "user-file-attachment"

    7. 
        
    dkus
    reviewbot
    1. Tool: Pyflakes
      Processed Files:
          reviewboard/attachments/evolutions/file_attachment_uuid.py
          reviewboard/attachments/evolutions/__init__.py
          reviewboard/attachments/views.py
          reviewboard/attachments/models.py
          reviewboard/urls.py
      
      
      
      Tool: PEP8 Style Checker
      Processed Files:
          reviewboard/attachments/evolutions/file_attachment_uuid.py
          reviewboard/attachments/evolutions/__init__.py
          reviewboard/attachments/views.py
          reviewboard/attachments/models.py
          reviewboard/urls.py
      
      
    2. 
        
    chipx86
    1. 
        
    2. reviewboard/attachments/views.py (Diff revision 2)
       
       
      Show all issues

      "URL", "UUID", and "a its" -> "its".

    3. 
        
    dkus
    reviewbot
    1. Tool: Pyflakes
      Processed Files:
          reviewboard/attachments/evolutions/file_attachment_uuid.py
          reviewboard/attachments/evolutions/__init__.py
          reviewboard/attachments/views.py
          reviewboard/attachments/models.py
          reviewboard/urls.py
      
      
      
      Tool: PEP8 Style Checker
      Processed Files:
          reviewboard/attachments/evolutions/file_attachment_uuid.py
          reviewboard/attachments/evolutions/__init__.py
          reviewboard/attachments/views.py
          reviewboard/attachments/models.py
          reviewboard/urls.py
      
      
    2. 
        
    brennie
    1. Ship It!
    2. 
        
    dkus
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to ucosp/dkus/dnd-inline-images (c48f1be)