#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:
› <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 , 11 years ago
Resolution: | → needsinfo |
---|---|
Status: | new → closed |
comment:3 by , 11 years ago
Yes, I added this on my test setup, but wasn't able to reproduce either.
Note:
See TracTickets
for help on using tickets.
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?