#36995: Improve KeyError message in Form.__getitem__
-----------------------+-----------------------------------------
Reporter: shiva | Type: Uncategorized
Status: new | Component: Uncategorized
Version: 6.0 | Severity: Normal
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------+-----------------------------------------
Currently, Form.__getitem__ raises a KeyError with a message that may be
unclear.
Proposed improvement:
Make the error message more descriptive by explicitly stating that the
field is not found in the form and listing available fields.
I have a working patch with updated tests.
--
Ticket URL: <
https://code.djangoproject.com/ticket/36995>
Django <
https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.