• 
      

    Fix the comment dialog when not logged in.

    Review Request #4047 — Created April 13, 2013 and submitted

    Information

    Review Board
    master

    Reviewers

    Fix the comment dialog when not logged in.
    
    The comment dialog has been broken for a little while when not logged
    in.
    
    We were attempting to fetch the review draft when unauthenticated. This
    triggered the browser's HTTP Auth login dialog, which is not what we
    wanted. Instead, we want to see that we're not authenticated and error
    out.
    
    This combined with my object destruction and UserSession changes fixes
    breakages for logged out users trying to make comments. We cleanly tell
    the user now that they need to log in, without popping up any broken
    login dialogs.
    
    Unit tests were added here to ensure that that works. Part of this
    involves moving our comment dialog template inline to give it access to
    our UserSession, so we can test against the different states.
    Tested the comment dialog on file attachments and diffs in both
    logged in and logged out states.
    
    Unit tests pass.
    reviewbot
    1. This is a review from Review Bot.
        Tool: PEP8 Style Checker
        Processed Files:
        Ignored Files:
          reviewboard/static/rb/js/views/tests/commentDialogViewTests.js
          reviewboard/templates/base.html
          reviewboard/static/rb/js/views/commentDialogView.js
          reviewboard/templates/js/tests.html
          reviewboard/static/rb/js/models/draftResourceModelMixin.js
          reviewboard/templates/reviews/comments_dlg.html
          reviewboard/templates/reviews/reviewable_base.html
          reviewboard/static/rb/js/models/userSessionModel.js
      
      
    2. 
        
    david
    1. Ship It!
    2. 
        
    chipx86
    Review request changed
    Status:
    Completed