Opened 5 years ago

Closed 5 years ago

#12456 closed (fixed)

Make `django.forms.util.ValidationError` and `django.core.exceptions.ValidationError` share ancestry

Reported by: obeattie Owned by: Honza_Kral
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: UI/UX:

Description

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 5 years ago by Honza_Kral

  • Needs documentation unset
  • Needs tests unset
  • Owner changed from nobody to Honza_Kral
  • Patch needs improvement unset

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

comment:2 Changed 5 years ago by Honza_Kral

  • Triage Stage changed from Unreviewed to Fixed on a branch

comment:3 Changed 5 years ago by Honza_Kral

  • Resolution set to fixed
  • Status changed from new to closed

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

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