Fix the comment dialog when not logged in.

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

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.