Opened 7 years ago

Closed 7 years ago

#28556 closed Bug (needsinfo)

resolve of i18n_patterns does not match default language paths with prefix_default_language=False

Reported by: nielsole Owned by: nobody
Component: Internationalization Version: 1.11
Severity: Normal Keywords: i18n, reverse
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by nielsole)

I believe this to be a follow-up of #27402


urlpatterns += i18n_patterns(
   url(r'^', include('main.urls', namespace="main")),

Now in a custom tag I try to resolve the URL(e.g. '/login/', '/en/login/'). This fails if the path is not prefixed(e.g. '/login/'):
### my_custom_tag

path = context['request'].path
url_parts = resolve(path) # raises 404

The URL of course exists as it is the current URL directly from the context.

My version: 1.11.4
Sorry for the brief bug report, but my laptop is running out of battery and I don't have a charger

Attachments (1)

28556-test.diff (1.2 KB ) - added by Tim Graham 7 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 by nielsole, 7 years ago

Description: modified (diff)

by Tim Graham, 7 years ago

Attachment: 28556-test.diff added

comment:2 by Tim Graham, 7 years ago

I'm unable to reproduce the problem given the information you provided. I attached the test for Django's test suite that I used. Can you modify it to demonstrate the issue?

comment:3 by Tim Graham, 7 years ago

Resolution: needsinfo
Status: newclosed
Note: See TracTickets for help on using tickets.
Back to Top