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 )
I believe this to be a follow-up of #27402
### urls.py
urlpatterns += i18n_patterns( url(r'^', include('main.urls', namespace="main")), prefix_default_language=False)
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)
Change History (4)
comment:1 by , 7 years ago
Description: | modified (diff) |
---|
by , 7 years ago
Attachment: | 28556-test.diff added |
---|
comment:2 by , 7 years ago
comment:3 by , 7 years ago
Resolution: | → needsinfo |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
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?