Opened 12 years ago
Closed 12 years ago
#20464 closed Bug (fixed)
admin list_editable displays wrong error messages
Reported by: | Marc Egli | Owned by: | Baptiste Mispelon |
---|---|---|---|
Component: | Forms | Version: | dev |
Severity: | Normal | Keywords: | admin |
Cc: | bmispelon@… | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
Considering the following ModelAdmin
:
class SomeModelAdmin(admin.ModelAdmin): list_display = ('pk', 'one', 'two') list_editable = ('one', 'two')
If you have errors in your form there is either Please correct the error below.
or Please correct the errors below.
. But this distinction is made on the count of forms having errors not on the total error count.
- If you have one entry and manage to have errors in both fields then it uses
Please correct the error below.
- If you have two entries and you have one error in one of them it says
Please correct the errors below.
Change History (5)
comment:1 by , 12 years ago
Easy pickings: | set |
---|---|
UI/UX: | set |
comment:2 by , 12 years ago
Cc: | added |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:3 by , 12 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:4 by , 12 years ago
Component: | contrib.admin → Forms |
---|---|
Has patch: | set |
UI/UX: | unset |
Pull request here: https://github.com/django/django/pull/1275
comment:5 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
I'm looking into it and the issue stems from the fact that {{ formset.error }} is a list that has as many elements as the number of forms in the formset.
To fix this, I'm thinking of introducing a new method on formsets:
total_error_count
that would count all the actual errors.I'll have a pull request ready soon.