#21299 closed Bug (fixed)

verbose_name inconsistently capitalized in admin inlines

Reported by: renatooliveira Owned by: nobody
Component: contrib.admin Version: 1.5
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

When I create an instance of a BaseInlineAdmin, the given verbose_name is capitalized. If I give an abbreviation like 'ABC' to verbose_name, it displays 'Abc'.

The same behavior happens in the verbose_name_plural, but only in the StackedInline model.

I'm willing to fix this if it's accepted as a bug.

Change History (4)

comment:1 Changed 23 months ago by renatooliveira

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

Sorry, InlineModelAdmin

comment:2 Changed 23 months ago by timo

  • Summary changed from verbose_name capitalized in Admin inlines to verbose_name inconsistently capitalized in admin inlines
  • Triage Stage changed from Unreviewed to Accepted
  • Type changed from Uncategorized to Bug

django/contrib/admin/templates/admin/edit_inline/stacked.html uses the title filter, while tabular.html uses capfirst. I suppose both could use capfirst.

The bug stems from this behavior of the title filter:

>>> from django.template.defaultfilters import capfirst, title
>>> title("ABC News")
u'Abc News'

I've created #21306 to document (or possibly change) this behavior.

comment:3 Changed 23 months ago by renatooliveira

I sent a pull request, but I don't know how to test this.

https://github.com/django/django/pull/1800

comment:4 Changed 23 months ago by Tim Graham <timograham@…>

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

In 43569647ab234cd1d2f4d41399b97b4b793d573a:

Fixed #21299 - Changed filters from title to capfirst on admin inline formsets.

Previously there was a mixture of the two which resulted in inconsistent
casing.

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