[Django] #21579: i18n_patterns redirect not working with script prefix (sub path)

63 views
Skip to first unread message

Django

unread,
Dec 8, 2013, 1:30:10 PM12/8/13
to django-...@googlegroups.com
#21579: i18n_patterns redirect not working with script prefix (sub path)
-------------------------+-------------------------------------------------
Reporter: | Owner: nobody
buettgenbach@… | Status: new
Type: Bug | Version: master
Component: Core | Keywords: i18n_patterns SCRIPT_NAME i18n
(URLs) | prefix
Severity: Normal | Has patch: 1
Triage Stage: | UI/UX: 0
Unreviewed |
Easy pickings: 0 |
-------------------------+-------------------------------------------------
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???)

--
Ticket URL: <https://code.djangoproject.com/ticket/21579>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Feb 22, 2014, 10:42:00 AM2/22/14
to django-...@googlegroups.com
#21579: i18n_patterns redirect not working with script prefix (sub path)
-------------------------------------+-------------------------------------
Reporter: buettgenbach@… | Owner: nobody
Type: Bug | Status: new
Component: Core (URLs) | Version: master
Severity: Normal | Resolution:
Keywords: i18n_patterns | Triage Stage: Accepted
SCRIPT_NAME i18n prefix | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by bpeschier):

* needs_better_patch: => 0
* stage: Unreviewed => Accepted
* needs_tests: => 0
* needs_docs: => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/21579#comment:1>

Django

unread,
May 18, 2014, 5:23:15 PM5/18/14
to django-...@googlegroups.com
#21579: i18n_patterns redirect not working with script prefix (sub path)
-------------------------------------+-------------------------------------
Reporter: buettgenbach@… | Owner: nobody
Type: Bug | Status: new
Component: Core (URLs) | Version: master
Severity: Normal | Resolution:
Keywords: i18n_patterns | Triage Stage: Accepted
SCRIPT_NAME i18n prefix | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by mrhanky@…):

Are there any reasons this didn't made it into Django so far?

--
Ticket URL: <https://code.djangoproject.com/ticket/21579#comment:2>

Django

unread,
May 18, 2014, 5:37:40 PM5/18/14
to django-...@googlegroups.com
#21579: i18n_patterns redirect not working with script prefix (sub path)
-------------------------------------+-------------------------------------
Reporter: buettgenbach@… | Owner: nobody
Type: Bug | Status: new
Component: Core (URLs) | Version: master
Severity: Normal | Resolution:
Keywords: i18n_patterns | Triage Stage: Accepted
SCRIPT_NAME i18n prefix | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by timo):

No one has reviewed the patch and marked the ticket "ready for checkin".

--
Ticket URL: <https://code.djangoproject.com/ticket/21579#comment:3>

Django

unread,
Aug 14, 2014, 9:39:23 AM8/14/14
to django-...@googlegroups.com
#21579: i18n_patterns redirect not working with script prefix (sub path)
-------------------------------------+-------------------------------------
Reporter: buettgenbach@… | Owner: nobody
Type: Bug | Status: new
Component: Core (URLs) | Version: master
Severity: Normal | Resolution:
Keywords: i18n_patterns | Triage Stage: Ready for
SCRIPT_NAME i18n prefix | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* stage: Accepted => Ready for checkin


Comment:

Patch looks okay to me. I cleaned up some trailing whitespace other flake8
issues and made a [https://github.com/django/django/pull/3065 PR] to make
sure all the tests are passing.

--
Ticket URL: <https://code.djangoproject.com/ticket/21579#comment:4>

Django

unread,
Aug 14, 2014, 10:27:37 AM8/14/14
to django-...@googlegroups.com
#21579: i18n_patterns redirect not working with script prefix (sub path)
-------------------------------------+-------------------------------------
Reporter: buettgenbach@… | Owner: nobody
Type: Bug | Status: closed

Component: Core (URLs) | Version: master
Severity: Normal | Resolution: fixed

Keywords: i18n_patterns | Triage Stage: Ready for
SCRIPT_NAME i18n prefix | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"fe38be96c1769ee83c65246704d2ae435c8d4150"]:
{{{
#!CommitTicketReference repository=""
revision="fe38be96c1769ee83c65246704d2ae435c8d4150"
Fixed #21579 -- Made LocaleMiddleware respect script prefix.

Thanks buettgenbach at datacollect.com for the report and patch.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/21579#comment:5>

Reply all
Reply to author
Forward
0 new messages