From f2ef556f613c7f744f13a9b5084ac51d93da4387 Mon Sep 17 00:00:00 2001
From: Chandresh Thakkar
Date: Wed, 10 Feb 2021 15:35:34 +0530
Subject: [PATCH] [MIG] auth_session_timeout: Migration to 14.0
---
auth_session_timeout/README.rst | 11 +++++----
auth_session_timeout/__manifest__.py | 4 ++--
.../data/ir_config_parameter_data.xml | 1 -
.../i18n/auth_session_timeout.pot | 23 ++++++++++++++++++-
.../models/ir_config_parameter.py | 18 +++++++++++++--
auth_session_timeout/models/ir_http.py | 4 ++--
auth_session_timeout/models/res_users.py | 8 +++++--
auth_session_timeout/readme/CONTRIBUTORS.rst | 1 +
.../static/description/index.html | 7 +++---
auth_session_timeout/tests/test_res_users.py | 11 +++++----
10 files changed, 65 insertions(+), 23 deletions(-)
diff --git a/auth_session_timeout/README.rst b/auth_session_timeout/README.rst
index d2acd87168..adf467935e 100644
--- a/auth_session_timeout/README.rst
+++ b/auth_session_timeout/README.rst
@@ -14,13 +14,13 @@ Inactive Sessions Timeout
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--auth-lightgray.png?logo=github
- :target: https://github.com/OCA/server-auth/tree/13.0/auth_session_timeout
+ :target: https://github.com/OCA/server-auth/tree/14.0/auth_session_timeout
:alt: OCA/server-auth
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
- :target: https://translation.odoo-community.org/projects/server-auth-13-0/server-auth-13-0-auth_session_timeout
+ :target: https://translation.odoo-community.org/projects/server-auth-14-0/server-auth-14-0-auth_session_timeout
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
- :target: https://runbot.odoo-community.org/runbot/251/13.0
+ :target: https://runbot.odoo-community.org/runbot/251/14.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -56,7 +56,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues `_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
-`feedback `_.
+`feedback `_.
Do not contact contributors directly about support or help with technical issues.
@@ -79,6 +79,7 @@ Contributors
* Jesse Morgan
* Dave Lasley
* Nadia Afakrouch
+* Chandresh Thakkar
Maintainers
~~~~~~~~~~~
@@ -93,6 +94,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
-This module is part of the `OCA/server-auth `_ project on GitHub.
+This module is part of the `OCA/server-auth `_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/auth_session_timeout/__manifest__.py b/auth_session_timeout/__manifest__.py
index 5cfd6fdfe5..953dc116b0 100644
--- a/auth_session_timeout/__manifest__.py
+++ b/auth_session_timeout/__manifest__.py
@@ -11,9 +11,9 @@
"LasLabs, "
"Odoo Community Association (OCA)",
"maintainer": "Odoo Community Association (OCA)",
- "website": "http://www.github.com/OCA/server-auth",
+ "website": "https://github.com/OCA/server-auth",
"category": "Tools",
- "version": "13.0.1.0.0",
+ "version": "14.0.1.0.0",
"license": "AGPL-3",
"data": ["data/ir_config_parameter_data.xml"],
"installable": True,
diff --git a/auth_session_timeout/data/ir_config_parameter_data.xml b/auth_session_timeout/data/ir_config_parameter_data.xml
index 20c53a21fc..b64c5a8c61 100644
--- a/auth_session_timeout/data/ir_config_parameter_data.xml
+++ b/auth_session_timeout/data/ir_config_parameter_data.xml
@@ -1,4 +1,3 @@
-
-

+

This module was written to be able to kill(logout) all inactive sessions since
a given delay. On each request the server checks if the session is yet valid
regarding the expiration delay. If not a clean logout is operated.
@@ -404,7 +404,7 @@
Bugs are tracked on GitHub Issues.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
-feedback.
+feedback.
Do not contact contributors directly about support or help with technical issues.
@@ -435,7 +436,7 @@
OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
-
This module is part of the OCA/server-auth project on GitHub.
+
This module is part of the OCA/server-auth project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/auth_session_timeout/tests/test_res_users.py b/auth_session_timeout/tests/test_res_users.py
index c2c65bb0ea..eb795ffdb7 100644
--- a/auth_session_timeout/tests/test_res_users.py
+++ b/auth_session_timeout/tests/test_res_users.py
@@ -14,8 +14,6 @@
class EndTestException(Exception):
""" It stops tests from continuing """
- pass
-
class TestResUsers(TransactionCase):
def setUp(self):
@@ -24,7 +22,7 @@ def setUp(self):
@contextmanager
def _mock_assets(self, assets=None):
- """ It provides mocked imports from res_users.py
+ """It provides mocked imports from res_users.py
:param assets: (list) Name of imports to mock. Mocks `http` if None
:return: (dict) Dictionary of mocks, keyed by module name
"""
@@ -74,7 +72,9 @@ def test_session_validity_logout(self):
assets["getmtime"].return_value = 0
with self.assertRaises(SessionExpiredException):
self._auth_timeout_check(assets["http"])
- assets["http"].request.session.logout.assert_called_once_with(keep_db=True,)
+ assets["http"].request.session.logout.assert_called_once_with(
+ keep_db=True,
+ )
def test_session_validity_updates_utime(self):
""" It should update utime of session file if not expired """
@@ -84,7 +84,8 @@ def test_session_validity_updates_utime(self):
assets["getmtime"].return_value = time.time()
self._auth_timeout_check(assets["http"])
assets["utime"].assert_called_once_with(
- assets["http"].root.session_store.get_session_filename(), None,
+ assets["http"].root.session_store.get_session_filename(),
+ None,
)
@mute_logger("odoo.addons.auth_session_timeout.models.res_users")