Opened 11 years ago

Closed 11 years ago

#3869 closed (worksforme)

newforms form.errors.__all__ cannot render

Reported by: David S. <davidschein@…> Owned by: Adrian Holovaty
Component: Forms Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


If you implement a clean method on your newform and raise a validation error it is keyed on 'all'.

But, {{ form.errors.all }} raises a template error: "Variables and attributes may not begin with underscores: 'form.errors.all'"

Workaround is to put pass the form level errors the template context somewhere, e.g. form_errors=search_form.errors.get('all', None).

Change History (2)

comment:1 Changed 11 years ago by David S. <davidschein@…>

Sorry, each underlined all should read more like _ _all_ _.

comment:2 Changed 11 years ago by Adrian Holovaty

Resolution: worksforme
Status: newclosed

Use form.non_field_errors to access the errors that aren't associated with a particular field.

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