kevinmickey / django-prettyjson

Enables pretty JSON viewer in Django forms, admin, or templates
BSD 3-Clause "New" or "Revised" License
139 stars 21 forks source link

PrettyJSONWidget() does not return form error test #32

Open cjd33g8n opened 2 years ago

cjd33g8n commented 2 years ago

Hello, I noticed that when you are returning a custom error in a ModelForm that uses the PrettyJsonWidget(), there is an indication that there is an error in that field, but it does not show the error message. In my use case I am overriding the clean() method on the ModelForm and using the add_error() method to return a custom error message on the field. When I use a TextField instead of the PrettyJsonWidget the error shows up, but does not when I am using the supplied widget.