Fix unicode problems in BaseReviewRequestDetails.__str__

The BaseReviewRequestDetails __str__ method was returning unicode, even for
python 2. Most of the time this wasn't an issue, since we don't use that method
very much, but if the summary contained unicode characters, it could break the
admin UI. Making this class use the @python_2_unicode_compatible decorator
fixes this.

Testing done: Ran new unit test.

Fixes bug 3325.

Reviewed at https://reviews.reviewboard.org/r/5770/
Fix dependency checks in manage.py

Our dependency checks (which print errors and warnings when running the
devserver) weren't working, because of the changes in how the settings module
is defined. We used to check whether the settings module was defined in the
environment, but when we switched to Django 1.5, we started inserting that into
the environment ourselves. I've added a flag to check whether or not we're in a
subprocess.

Testing done:
Ran the devserver and saw it run the dependency checks (but only once).

Reviewed at https://reviews.reviewboard.org/r/5770/
Add missing documentation for API errors.

We introduced a number of API errors since we last updated the
documentation for this, but we never added the API docs. These could
still use some work, but at least we now have something to link to.

Reviewed at https://reviews.reviewboard.org/r/5777/
Revert the change to the recaptcha import test.

For some mysterious reason, recaptcha doesn't always work with
imp.find_module(). It works fine in my virtualenv, but not in Christian's,
despite everything looking very similar.

This changes our test back to using 'import', and crucially adds a comment
explaining why we use that over imp.find_module().

Reviewed at https://reviews.reviewboard.org/r/5776/
Fix the post-commit creation to also create a draft.

Using the post-commit UI would create a ReviewRequest object with public=False,
but wouldn't create an associated draft. This meant that the review request
looked like it was public but wasn't.

Testing done:
Created a post-commit review request and saw the "This review request is not
yet public" banner.

Reviewed at https://reviews.reviewboard.org/r/5780/
Improve the title for the Action Hooks page.

The Action Hooks page was called "ActionHook", but the page is actually
about a collection of action hooks. this is a trivial change to rename
it to "Action Hooks".
Fix displaying and publishing drafts for initial review requests.

A review request without a draft that is marked as public=False would be
shown with a draft banner on RB 1.7, but the work on 2.0 broke that.
This was partially due to a change when reorganizing the
review_header.html template, and was further hindered by some missing
logic in the views.

Now, a review request created through the New Review Request page
without a draft will once again have a banner, and the Publish and
Discard buttons will work again.

It also fixes an issue with the error callback for Publish. It turns out
that it didn't have the correct parameters.

Reviewed at https://reviews.reviewboard.org/r/5781/
Add release notes for 2.0 RC 3.

This covers all the fixes and improvements made in 2.0 RC 3. There's a
number of bug fixes, performance improvements, extensibility
improvements, and a couple experimental Web Hook additions in here.

Reviewed at https://reviews.reviewboard.org/r/5758/
Add input escaping to the bugs section of review

If you create a new review and type a string that should be escaped into the
bugs secion (e.g. <A>), it disappears. Can be fixed by using view.formatText
that escapes input. Note that even though the text that you entered isn't
displayed, if you refresh the review, it's there, and is displayed, as the
template has "|safe" in it. The problem is only visible after immediate value
update.

There are a couple of other fields that might have the same issue, but none of
them (depends on, target groups) are likely to have input that should be
escaped in them.

Testing Done:
Before:
1) Created a new review.
2) Click edit on bug description.
3) Enter "<A>" into the field and press enter.
4) Text disappears.

After:
1) Created a new review.
2) Click edit on bug description.
3) Enter "<A>" into the field and press enter.
4) Text is there, just as expected.

Also tested behaviour with multiple inputs like "<123> <456>".

Bugs closed: 3244

Reviewed at https://reviews.reviewboard.org/r/5774/
Make a small improvement to unicode diffs in 1.7.x

Generally, Review Board 2.0's support for unicode is much, much better than
1.7.x, but this is a small enough change that it's probably worth making. Some
of the filename processing can do operations which will fail if the filenames
an un-decoded utf8, so convert all filenames from diffs to unicode if the
SCMTool didn't already.

Testing done: Ran unit tests.

Reviewed at https://reviews.reviewboard.org/r/5784/
Merge branch 'release-1.7.x' into release-2.0.x
Update the 2.0 RC 3 release notes for the Djblets changes.

The release notes were lacking some of the more key changes made to
Djblets. This updates them to include those changes as well.
Release Review Board 2.0 RC 3.
Fix a typo.
Avoid showing change of password form if the auth backend doesn't support it.

If an authentication backend has supports_change_password set to False, the
account preferences panel still shows the form to change the password, while it
shouldn't be there.

The problem here is that the is_visible() implementation was located in the
wrong class. Instead of being in ChangePasswordForm, it ended up in
AccountSettingsForm, so that if the auth backend didn't have the ability to
change the password, it would instead prevent the user from changing their
timezone.

Testing Done:

Before: If you use a backend that has supports_change_password as False, your
/account/preferences page still has Authentication tab, which corresponds to
password changing. If you try to change your password, you get an error as
described in the bug. You can also notice that the settings bar went missing
for some reason.

After: If supports_change_password is False for your backend, the
Authentication tab isn't visible, and the Settings tab is back!

I also verified that nothing changed for backends that support password change.

Bugs closed: 3255

Reviewed at https://reviews.reviewboard.org/r/5797/
Prevent JavaScript errors on the Manual Updates pages.

The Manual Updates page tried to load the JS catalog, needed in order to
expose gettext() for the other scripts being loaded. That path wasn't
explicitly allowed, resulting in HTML being sent back as the script
contents, causing the browser to show some errors.

We may want to consider just blocking off all script loading. That will
require blocking extensions as well, though, and possibly daeling with
other corner cases. In the meantime, allow the JS catalog to be loaded.

Reviewed at https://reviews.reviewboard.org/r/5800/
Fix the styling of titles in the admin UI.

Titles in the admin UI were previously styled by the 'h1.title' rule,
which we replaced with '.box-title'. However, the admin UI doesn't use
boxes in the same sense as the rest of the UI, due to Django's built-in
styling.

This adds an explicit rule for titles in the admin UI, allowing them
once again to use the same styles as our other boxes.

Reviewed at https://reviews.reviewboard.org/r/5801/
Fix fetching original and patched files through the web API.

The handlers for getting original/patched files in the API were
expecting a URL parameter that doesn't exist. It would always attempt to
fetch using the draft filediff resource, instead of intelligently
choosing between that and the published filediff resource.

By using the correct URL parameter name, and using that parameter
correctly, we can fetch the original/patched files correctly.

Reviewed at https://reviews.reviewboard.org/r/5804/
Remove the Pygments runtime dependency checks.

We have some really old code (Makefile days) for checking if syntax
highlighting can be enabled, based on having Pygments, and having a
minimum version of it. This code, in combination with some other code,
ends up creating some ugly and unnecessary circular dependencies between
parts of the product that only appear if you start importing certain
modules first.

These days, we have actual dependencies that get installed with the
product. This check is no longer useful, and causes more harm than good.
This change removes the check and all calls.

Reviewed at https://reviews.reviewboard.org/r/5811/
Condense some unnecessarily verbose code in reviewboard.admin.

Due to changes made over time to the admin widget code, we ended up
having some code in reviewboard.admin.signals that didn't really belong
there. A signals.py file should be fairly minimal and contain actual
signals, but this one had just signal handlers that were called from
reviewboard.admin itself.

This change just removes the file and moves that code directly into
reviewboard.admin, to keep things simple and consistent.

Reviewed at https://reviews.reviewboard.org/r/5812/