Update RepositoryForm for LocalSiteAwareModelFormMixin.

Review Request #10371 — Created Jan. 2, 2019 and submitted — Latest diff uploaded

chipx86
Review Board
release-3.0.x
10364
7ebabda...
reviewboard

This updates RepositoryForm to use the new
LocalSiteAwareModelFormMixin, providing automatic validation of
related objects and the ability to limit choices to a LocalSite. This
simplifies a complex form just a bit, helping making it less likely that
a Local Site leak will occur down the road.

The largest part of this change is the introduction of new unit tests
that ensure that the form can be limited to a LocalSite without
problems. Otherwise, it's mostly about inheriting from the mixin,
removing old (redundant and slow) validation logic, and removing some
now unnecessary state tracking.

Unit tests pass.

Tested manually creating and modifying repositories, including changing
LocalSite associations.

Loading...