Opened 15 years ago
Closed 15 years ago
#12456 closed (fixed)
Make `django.forms.util.ValidationError` and `django.core.exceptions.ValidationError` share ancestry
Reported by: | Oliver Beattie | Owned by: | Honza Král |
---|---|---|---|
Component: | Forms | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Fixed on a branch | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
There appears to be two (similarly named) ValidationError
s in Django — one living in django.core
, and a form-specific one living in django.forms.util
. I can appreciate that they have slightly differing uses, but it does seem like they have a lot in common. So, there would be a few routes one could take here:-
- Alias
django.forms.util.ValidationError
to thedjango.core
one
- Make the forms version a subclass of the
django.core
one
- Make each share a common base exception
Given how the exceptions are used, I'd say #2 would seem to make the most sense here, and wouldn't break anything. It's already rather confusing having two similarly-named exceptions, so I couldn't really see it being any more confusing to do this.
Change History (3)
comment:1 by , 15 years ago
Owner: | changed from | to
---|
comment:2 by , 15 years ago
Triage Stage: | Unreviewed → Fixed on a branch |
---|
comment:3 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
With model-validation merged, this is fixed in [12098]
This is fixed in the model-validation branch (#6845) where there is only one ValidationError used throughout Django.