Fix the New Review Request form with hosting services.

Review Request #3139 — Created June 9, 2012 and submitted — Latest diff uploaded

Information

Review Board
release-1.6.x

Reviewers

Fix the New Review Request form with hosting services.

The New Review Request form ended up having problems with the repository
selected. Django seems to use defer() somewhere when providing an object
from a ModelChoiceField. This creates something designed to look like
the model we care about, but with some field changes. What ends up
happening is that our JSONField's serialized data gets copied over to
this model, not the dict we operate on. This fails later on when we
attempt to access data from this dict.

To fix this, we re-fetch the Repository based on the placeholder one.
This gives us a model that isn't screwed up that we can rely upon.
Created a review request with a diff on GitHub. It no longer blew up.
    Loading...