Skip to content

Commit

Permalink
Merge pull request #1722 from OCA/17.0
Browse files Browse the repository at this point in the history
Syncing from upstream OCA/server-tools (17.0)
  • Loading branch information
bt-admin authored Feb 6, 2025
2 parents a7057e4 + 5319d1b commit 1e40254
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ addon | version | maintainers | summary
[scheduler_error_mailer](scheduler_error_mailer/) | 17.0.1.0.0 | | Scheduler Error Mailer
[sentry](sentry/) | 17.0.1.0.0 | [![barsi](https://github.com/barsi.png?size=30px)](https://github.com/barsi) [![naglis](https://github.com/naglis.png?size=30px)](https://github.com/naglis) [![versada](https://github.com/versada.png?size=30px)](https://github.com/versada) [![moylop260](https://github.com/moylop260.png?size=30px)](https://github.com/moylop260) [![fernandahf](https://github.com/fernandahf.png?size=30px)](https://github.com/fernandahf) | Report Odoo errors to Sentry
[server_action_logging](server_action_logging/) | 17.0.1.0.0 | | Module that provides a logging mechanism for server actions
[session_db](session_db/) | 17.0.1.0.0 | [![sbidoul](https://github.com/sbidoul.png?size=30px)](https://github.com/sbidoul) | Store sessions in DB
[session_db](session_db/) | 17.0.1.0.1 | [![sbidoul](https://github.com/sbidoul.png?size=30px)](https://github.com/sbidoul) | Store sessions in DB
[tracking_manager](tracking_manager/) | 17.0.1.0.7 | [![Kev-Roche](https://github.com/Kev-Roche.png?size=30px)](https://github.com/Kev-Roche) [![sebastienbeau](https://github.com/sebastienbeau.png?size=30px)](https://github.com/sebastienbeau) | This module tracks all fields of a model, including one2many and many2many ones.
[upgrade_analysis](upgrade_analysis/) | 17.0.1.0.2 | [![StefanRijnhart](https://github.com/StefanRijnhart.png?size=30px)](https://github.com/StefanRijnhart) [![legalsylvain](https://github.com/legalsylvain.png?size=30px)](https://github.com/legalsylvain) | Performs a difference analysis between modules installed on two different Odoo instances

Expand Down
2 changes: 1 addition & 1 deletion session_db/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Store sessions in DB
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:7f625ad3c63b7ad41974310cc447302e517eb7fe62290a60ceec8f0325b80853
!! source digest: sha256:5c0fbec69462917f226c2bad6ac45c51185c1ce8c50d7da7908e2b7be3b476a8
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down
2 changes: 1 addition & 1 deletion session_db/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Store sessions in DB",
"version": "17.0.1.0.0",
"version": "17.0.1.0.1",
"author": "Odoo SA,ACSONE SA/NV,Odoo Community Association (OCA)",
"license": "LGPL-3",
"website": "https://github.com/OCA/server-tools",
Expand Down
2 changes: 1 addition & 1 deletion session_db/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Store sessions in DB</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:7f625ad3c63b7ad41974310cc447302e517eb7fe62290a60ceec8f0325b80853
!! source digest: sha256:5c0fbec69462917f226c2bad6ac45c51185c1ce8c50d7da7908e2b7be3b476a8
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/server-tools/tree/17.0/session_db"><img alt="OCA/server-tools" src="https://img.shields.io/badge/github-OCA%2Fserver--tools-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/server-tools-17-0/server-tools-17-0-session_db"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/server-tools&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>Store sessions in a database instead of the filesystem. This simplifies
Expand Down
18 changes: 15 additions & 3 deletions session_db/tests/test_pg_session_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@


def _make_postgres_uri(
login=None, password=None, host=None, port=None, database=None, **kwargs
user=None, password=None, host=None, port=None, database=None, **kwargs
):
uri = ["postgres://"]
if login:
uri.append(login)
if user:
uri.append(user)
if password:
uri.append(f":{password}")
uri.append("@")
Expand Down Expand Up @@ -80,3 +80,15 @@ def test_retry_connect_fail(self):
assert mock_execute.call_count == 1
# when the error is resolved, it works again
self.session_store.get("abc")

def test_make_postgres_uri(self):
connection_info = {
"host": "localhost",
"port": 5432,
"database": "test",
"user": "test",
"password": "PASSWORD",
}
assert "postgres://test:PASSWORD@localhost:5432/test" == _make_postgres_uri(
**connection_info
)

0 comments on commit 1e40254

Please sign in to comment.