[PR #2788] [MERGED] Change middlwares order and set cookies cookies instead of using depr… #2687

Closed
opened 2026-02-27 12:12:16 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/modoboa/modoboa/pull/2788
Author: @moweerkat
Created: 2/17/2023
Status: Merged
Merged: 2/17/2023
Merged by: @tonioo

Base: masterHead: fix/interface_v1_fix_language_switch


📝 Commits (2)

  • 0424a6c Change middlwares order and set cookies cookies instead of using deprecated sessions for language switching
  • 117037f Fix return

📊 Changes

5 files changed (+16 additions, -14 deletions)

View changed files

📝 doc/upgrade.rst (+2 -2)
📝 modoboa/core/commands/templates/settings.py.tpl (+2 -2)
📝 modoboa/core/views/auth.py (+5 -3)
📝 modoboa/core/views/user.py (+5 -5)
📝 test_project/test_project/settings.py (+2 -2)

📄 Description

Description of the issue/feature this PR addresses:

https://github.com/modoboa/modoboa/issues/2719

Setting language in sessions is deprecated in Django since 3.0. Set a cookie instead. Also update the middlewares order to match the requirements.

https://docs.djangoproject.com/en/3.0/topics/i18n/translation/#explicitly-setting-the-active-language

Current behavior before PR:

Cannot switch from one language to another with the old interface.

Desired behavior after PR is merged:

It fixes it


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/modoboa/modoboa/pull/2788 **Author:** [@moweerkat](https://github.com/moweerkat) **Created:** 2/17/2023 **Status:** ✅ Merged **Merged:** 2/17/2023 **Merged by:** [@tonioo](https://github.com/tonioo) **Base:** `master` ← **Head:** `fix/interface_v1_fix_language_switch` --- ### 📝 Commits (2) - [`0424a6c`](https://github.com/modoboa/modoboa/commit/0424a6c88b881b7e1e7f5cafcac17f2ffaf9691b) Change middlwares order and set cookies cookies instead of using deprecated sessions for language switching - [`117037f`](https://github.com/modoboa/modoboa/commit/117037f5aa9d23d81793a24f18ed37d8217d5cad) Fix return ### 📊 Changes **5 files changed** (+16 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `doc/upgrade.rst` (+2 -2) 📝 `modoboa/core/commands/templates/settings.py.tpl` (+2 -2) 📝 `modoboa/core/views/auth.py` (+5 -3) 📝 `modoboa/core/views/user.py` (+5 -5) 📝 `test_project/test_project/settings.py` (+2 -2) </details> ### 📄 Description Description of the issue/feature this PR addresses: https://github.com/modoboa/modoboa/issues/2719 Setting language in sessions is deprecated in Django since 3.0. Set a cookie instead. Also update the middlewares order to match the requirements. https://docs.djangoproject.com/en/3.0/topics/i18n/translation/#explicitly-setting-the-active-language Current behavior before PR: Cannot switch from one language to another with the old interface. Desired behavior after PR is merged: It fixes it --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 12:12:16 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/modoboa-modoboa#2687
No description provided.