Opened 8 years ago

Closed 8 years ago

#3139 closed defect (fixed)

[patch] BoundField._errors() returns an empty ErrorList() when using Form's prefix option

Reported by: jkocherhans Owned by: adrian
Component: Forms Version:
Severity: normal Keywords:
Cc: jkocherhans@… Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

_errors() looks for self.form.errors[self.name], which is fine until you use a prefix. In that case, self.name is the prefixed version which won't and shouldn't be found in form.errors

Attachments (1)

prefix-errors.diff (2.3 KB) - added by jkocherhans 8 years ago.
The fix could probably be simpler, but I think this is more clear.

Download all attachments as: .zip

Change History (3)

Changed 8 years ago by jkocherhans

The fix could probably be simpler, but I think this is more clear.

comment:1 Changed 8 years ago by jkocherhans

  • Cc jkocherhans@… added
  • Component changed from Admin interface to django.newforms

comment:2 Changed 8 years ago by adrian

  • Resolution set to fixed
  • Status changed from new to closed

(In [4199]) Fixed #3139 -- newforms BoundField no longer returns empty errors when using a prefix. Thanks, jkocherhans

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