Opened 12 years ago
Closed 11 years ago
#21579 closed Bug (fixed)
i18n_patterns redirect not working with script prefix (sub path)
| Reported by: | Owned by: | nobody | |
|---|---|---|---|
| Component: | Core (URLs) | Version: | dev |
| Severity: | Normal | Keywords: | i18n_patterns SCRIPT_NAME i18n prefix |
| 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
Assume the following url pattern:
urlpatterns += i18n_patterns('',
url(r'^imprint/$', view, name='imprint'),
)
"en" is the default language.
When running Django (for example behind a reverse proxy) a request to /imprint/ with SCRIPT_NAME='script_prefix" leads to the redirect "/en/script_prefix/imprint/" instead of "/script_prefix/en/imprint/".
I've already provided a patch with test. But I'm uncertain about the test, since the test client does not seem to call set_script_prefix (might be thought of as a bug???)
Attachments (1)
Change History (6)
by , 12 years ago
| Attachment: | i18n_patterns_with_script_name_patch.diff added |
|---|
comment:1 by , 12 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
comment:2 by , 11 years ago
comment:3 by , 11 years ago
No one has reviewed the patch and marked the ticket "ready for checkin".
comment:4 by , 11 years ago
| Triage Stage: | Accepted → Ready for checkin |
|---|
Patch looks okay to me. I cleaned up some trailing whitespace other flake8 issues and made a PR to make sure all the tests are passing.
comment:5 by , 11 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Are there any reasons this didn't made it into Django so far?