Opened 10 years ago

Closed 10 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: master
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


There appears to be two (similarly named) ValidationErrors 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:-

  1. Alias django.forms.util.ValidationError to the django.core one
  1. Make the forms version a subclass of the django.core one
  1. 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 Changed 10 years ago by Honza Král

Owner: changed from nobody to Honza Král

This is fixed in the model-validation branch (#6845) where there is only one ValidationError used throughout Django.

comment:2 Changed 10 years ago by Honza Král

Triage Stage: UnreviewedFixed on a branch

comment:3 Changed 10 years ago by Honza Král

Resolution: fixed
Status: newclosed

With model-validation merged, this is fixed in [12098]

Note: See TracTickets for help on using tickets.
Back to Top