Improve tracking of error information in RepositoryForm.

Review Request #10375 — Created Jan. 4, 2019 and submitted

chipx86
Review Board
release-3.0.x
9223d13...
reviewboard

RepositoryForm can raise many different types of errors. Some are
standard ValidationErrors that are handled by the form. Some are
attributes that get set that the template can render state from. None of
these are really easily distinguished except by the contents of the
error message, making them a bit useless outside of the form's internals
and the front-end page.

This change works toward improving RepositoryForm for usage outside of
the admin page. We now have an error code associated with most types of
ValidationErrors, and we store the error raised during form validation
so we can get to it later (a feature that newer versions of Django have
natively, but we do not). The repository verification code now just
worries about raising the errors, and the calling method stores those
and translates them into the individual attributes.

An upcoming change to the repository API will make use of this.

Unit tests pass.

Tested along with upcoming changes that make use of the new error codes.

Description From Last Updated

F821 undefined name 'SSHError'

reviewbotreviewbot

F821 undefined name 'SCMError'

reviewbotreviewbot
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

chipx86
david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-3.0.x (07b1bc2)
Loading...