Opened 9 years ago
Closed 9 years ago
#26271 closed Bug (fixed)
i18n_patterns() creates invalid url if no language is active
Reported by: | Marten Kenbeek | Owned by: | nobody |
---|---|---|---|
Component: | Core (URLs) | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
If get_language()
returns None
, reverse()
in combination with i18n_patterns()
will create an url prefixed with /None/
as the language code. The LocaleMiddleware
will activate a different language (it falls back to settings.LANGUAGE_CODE
if no other language is found), and the prefix will cause a 404.
This requires special-casing of if language_code is None
in LocaleRegexURLResolver.
Change History (4)
comment:1 by , 9 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 9 years ago
Has patch: | set |
---|
comment:3 by , 9 years ago
Triage Stage: | Accepted → Ready for checkin |
---|---|
Version: | 1.9 → master |
Note:
See TracTickets
for help on using tickets.
PR