• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

hypothesis / h / 6575
57%
master: 97%

Build:
Build:
LAST BUILD BRANCH: realtime-update-v1-h-only-1
DEFAULT BRANCH: master
Ran 05 Jun 2015 03:10PM UTC
Jobs 1
Files 63
Run time 5s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
6575

push

travis-ci

nickstenning
Support reporting top-level form validation errors

When we call `form.validate()` and the validation fails, the raised
exception is a `deform.ValidationFailure`. This object has an `error`
attribute which represents the underlying validation error object for
the entire form.

Previously, if the validation failure were a result of top-level
validation errors (such as the fact that an unactivated user is trying
to log in), this error would be lost, because we only reported errors
for the forms fields, or "children".

This commit changes `h.accounts.views.validate_form` so that it converts
the entire `colander.Invalid` object into a dictionary using its
`asdict()` instance method. By doing this, we get two immediate
benefits:

- top-level validation errors are reported in the '' (empty string)
  field
- we avoid the need to aggregate form field errors by hand in ajax_form

In addition, we need to deal with this case on the frontend, so this
commit also changes the formRespond directive so that if no overall
"reason" is provided for failure, then an empty-string member of the
"errors" object can set the overall validation status (and error
message) for the form.

4 of 4 new or added lines in 1 file covered. (100.0%)

1545 of 2762 relevant lines covered (55.94%)

0.56 hits per line

Uncovered Existing Lines

Lines Coverage ∆ File
40
100.0
h/accounts/views.py
Jobs
ID Job ID Ran Files Coverage
1 6575.1 05 Jun 2015 03:10PM UTC 0
55.94
Travis Job 6575.1
Source Files on build 6575
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #6575
  • 5b49aabb on github
  • Prev Build on report-form-level-errors (#6569)
  • Next Build on report-form-level-errors (#6584)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc