Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#21342 closed Bug (needsinfo)

Localized pk value in admin panel template

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

Description

Problem templates is:

django/contrib/admin/templates/admin/object_history.html
django/contrib/admin/templates/admin/delete_confirmation.html

line in “breadcrumbs” block:

&rsaquo; <a href="{% url opts|admin_urlname:'change' object.pk|admin_urlquote %}">{{ object|truncatewords:"18" }}</a>

My locale settings:

TIME_ZONE = 'Europe/Moscow'
LANGUAGE_CODE = 'ru-ru'
USE_I18N = True
USE_L10N = True
USE_TZ = False

When object.pk value is big, for example 123456, output looks like “123 456” and i got broken link: http://example.com/admin/auth/user/123%C2%A0456/.

I prefer to use “unlocalize” filter for prevent this issue.

Pull requests on GitHub:
https://github.com/django/django/pull/1810
https://github.com/django/django/pull/1811

Change History (4)

comment:1 by Claude Paroz, 11 years ago

Resolution: needsinfo
Status: newclosed

I cannot reproduce this issue, and I think that this should not arise when the value is a parameter of the url template tag. Are you able to provide us with a failing test case?

comment:2 by olevinskyvs, 11 years ago

I forgot one setting, sorry:

USE_THOUSAND_SEPARATOR = True

comment:3 by Claude Paroz, 11 years ago

Yes, I added this on my test setup, but wasn't able to reproduce either.

comment:4 by olevinskyvs, 11 years ago

Ok, i'll try to make a test for it.

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