Opened 2 years ago

Last modified 2 years ago

#33936 closed Bug

BaseModelForm.save() ValueError lacks useful information — at Initial Version

Reported by: Josh Moore Owned by: nobody
Component: Forms Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

We were hitting Airbrake errors in production where the only message provided was "The <model> could not be changed because the data didn't validate." This made it difficult to troubleshoot and debug the problem. The error message would be more useful if it included information about which specific form fields failed to validate and why.

I have prepared a patch which enhances the error message in the BaseModelForm save() method by including the actual form errors in the message, formatted as JSON.

This is my first time contributing to Django and using Trac, please forgive any mistakes I made filling out this form.

Change History (0)

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