Simplify RepositoryForm and add LocalSite validation.

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

chipx86
Review Board
reviewboard
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.
chipx86
Review request changed

Change Summary:

Typo

Summary:

-Simply RepositoryForm and add LocalSite validation.
+Simplify RepositoryForm and add LocalSite validation.

Description:

~  

Simply RepositoryForm and add LocalSite validation.

  ~

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.

david
  1. Ship It!
  2. 
      
Loading...