Improve tracking of error information in RepositoryForm.

Review Request #1535 — Created Jan. 18, 2019 and submitted

guest6774
Review Board
07b1bc2...
demo
`RepositoryForm` can raise many different types of errors. Some are
standard `ValidationError`s 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
`ValidationError`s, 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.

Testing Done:
Unit tests pass.

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

Reviewed at https://reviews.reviewboard.org/r/10375/


Description From Last Updated

Völliger Quatsch

guest6774guest6774
guest6774
  1. 
      
  2. reviewboard/scmtools/forms.py (Diff revision 1)
     
     
     

    Völliger Quatsch

  3. 
      
guest6774
Review request changed

Status: Closed (submitted)

Change Summary:

asdf

guest6285
  1. 
      
  2. 
      
Loading...