Simplify RepositoryForm and add LocalSite validation.

Review Request #2045 — Created Jan. 16, 2011 and submitted — Latest diff uploaded

Information

Review Board

Reviewers

Simplify RepositoryForm and add LocalSite validation.

This greatly simplifies RepositoryForm. We now tell the underlying ModelForm
that this is a form for the Repository model, and ModelForm handles most of
the fields we care about based on the Model. This required moving some
information to the Model, which is a better place for it anyway.

It also adds validation to check that the associated groups and users have
a valid LocalSite given the LocalSite of the Repository.

The validation logic is the same across all models that need it. They've been
moved to new validate_users and validate_review_groups functions in
reviewboard.site.validation.
Unit tests pass, and it seems to work from the admin UI.

I can still save non-LocalSite repositories.