[Django] #29716: Add a warning in LocaleMiddleware is after CommonMiddleware or before SessionMiddelware

2 views
Skip to first unread message

Django

unread,
Aug 27, 2018, 7:41:51 PM8/27/18
to django-...@googlegroups.com
#29716: Add a warning in LocaleMiddleware is after CommonMiddleware or before
SessionMiddelware
------------------------------------------------+--------------------------
Reporter: Sanyam Khurana | Owner: nobody
Type: Bug | Status: assigned
Component: Internationalization | Version: 2.1
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
------------------------------------------------+--------------------------
The `SessionMiddleware` sets the session cookie that may contain the
language code for Internationalization and translations.

If the LocaleMiddleware is not placed after SessionMiddleware, it won't be
able to find the language code and won't be able to `activate` the
language from HTTPRequest and use it.

So, if the order of these Middleware classes is not appropriate, a warning
should be displayed.

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

Django

unread,
Aug 27, 2018, 7:42:46 PM8/27/18
to django-...@googlegroups.com
#29716: Add a warning in LocaleMiddleware is after CommonMiddleware or before
SessionMiddelware
-------------------------------------+-------------------------------------
Reporter: Sanyam Khurana | Owner: Sanyam
| Khurana
Type: Bug | Status: assigned
Component: | Version: 2.1
Internationalization |
Severity: Normal | Resolution:

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sanyam Khurana):

* owner: nobody => Sanyam Khurana


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

Django

unread,
Aug 28, 2018, 7:53:34 AM8/28/18
to django-...@googlegroups.com
#29716: Add a warning in LocaleMiddleware is after CommonMiddleware or before
SessionMiddelware
-------------------------------------+-------------------------------------
Reporter: Sanyam Khurana | Owner: Sanyam
| Khurana
Type: Bug | Status: closed
Component: | Version: 2.1
Internationalization |
Severity: Normal | Resolution: wontfix

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Claude Paroz):

* status: assigned => closed
* resolution: => wontfix


Comment:

See ticket #15902, the language is now (from Django 2.1) also stored in a
cookie, that's why I think the issue you mention should not happen again
in the future.

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

Reply all
Reply to author
Forward
0 new messages