Opened 7 years ago

Last modified 7 years ago

#28556 closed Bug

resolve of i18n_patterns does not match default language paths with prefix_default_language=False — at Version 1

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

### 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

Change History (2)

comment:1 by nielsole, 7 years ago

Description: modified (diff)

by Tim Graham, 7 years ago

Attachment: 28556-test.diff added
Note: See TracTickets for help on using tickets.
Back to Top