• 
      

    Only bind hosting service forms when working with that service type.

    Review Request #9819 — Created March 22, 2018 and submitted

    Information

    Review Board
    release-3.0.x
    9cb0a3b...

    Reviewers

    RepositoryForm always fed in any submitted data to each repository and
    bug tracker form, with the idea being that those forms would ignore any
    data they didn't care about. This assumption was no longer valid with
    the addition of Gerrit, which assumed the existence of a field in the
    data, breaking all hosting services except for Gerrit.

    This bad assumption is also what would lead to validation errors
    appearing if submitting a form with bad/missing data and then switching
    hosting services or plans. Those previously-hidden forms would appear,
    showing that the fields were required.

    We now only bind data to a form if the form in question is the one we're
    posting to.

    Manually tested with and without hosting services, and with different
    setups for plans. Triggered validation errors and then went around other
    forms to make sure that other forms hadn't validated.

    I was also able to successfully submit without the gerrit_url error.

    Unit tests pass.

    brennie
    1. Ship It!
    2. 
        
    david
    1. Ship It!
    2. 
        
    chipx86
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to release-3.0.x (3c414d0)