Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#27922 closed New feature (fixed)

Add ErrorDict.get_json_data() method

Reported by: Tim Heap Owned by: nobody
Component: Forms Version: 1.10
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

This makes ErrorDict behave the same as ErrorList. ErrorDict.get_json_data() is useful when incorporating form validation errors inside a larger JSON response, where the JSON string output from ErrorDict.as_json() would not be appropriate.

Tests and docs have been updated to include the new function.

See https://github.com/django/django/pull/8163

Change History (5)

comment:1 by Tim Graham, 7 years ago

Patch needs improvement: set
Triage Stage: UnreviewedAccepted

Seems okay at first glance. Please review your patch using the PatchReviewChecklist as a few requirements such as release notes and versionadded annotations are missing.

comment:2 by Tim Heap, 7 years ago

I've added release notes to the 2.0 release document, and a versionadded: 2.0 note to the docs.

comment:3 by Tim Heap, 7 years ago

Patch needs improvement: unset

Is there anything else that needs adding to this patch?

comment:4 by Tim Graham <timograham@…>, 7 years ago

Resolution: fixed
Status: newclosed

In 5b6181f4:

Fixed #27922 -- Added ErrorDict.get_json_data().

comment:5 by Tim Heap, 7 years ago

Thanks!

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