Skip to content

Commit

Permalink
Merge pull request #1719 from OCA/16.0
Browse files Browse the repository at this point in the history
Syncing from upstream OCA/server-tools (16.0)
  • Loading branch information
bt-admin authored Feb 4, 2025
2 parents 7c661d3 + 179d06e commit 1a19211
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 @@ -72,7 +72,7 @@ addon | version | maintainers | summary
[sentry](sentry/) | 16.0.3.0.3 | [![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
[sequence_python](sequence_python/) | 16.0.1.0.0 | | Calculate a sequence number from a Python expression
[server_action_logging](server_action_logging/) | 16.0.1.0.0 | | Module that provides a logging mechanism for server actions
[session_db](session_db/) | 16.0.1.0.6 | [![sbidoul](https://github.com/sbidoul.png?size=30px)](https://github.com/sbidoul) | Store sessions in DB
[session_db](session_db/) | 16.0.1.0.7 | [![sbidoul](https://github.com/sbidoul.png?size=30px)](https://github.com/sbidoul) | Store sessions in DB
[tracking_manager](tracking_manager/) | 16.0.1.1.8 | [![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/) | 16.0.1.2.0 | [![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
[url_attachment_search_fuzzy](url_attachment_search_fuzzy/) | 16.0.1.0.0 | [![mariadforgelow](https://github.com/mariadforgelow.png?size=30px)](https://github.com/mariadforgelow) | Fuzzy Search of URL in Attachments
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:ef7800d98b71197aac45a4115c49d2ed27f3cff4e13553a622ea4f97f7d96d4b
!! source digest: sha256:59a43b0f19a6177d8866b3524a34ec9f9b380f29765d4d9647254dba9248b2f1
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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": "16.0.1.0.6",
"version": "16.0.1.0.7",
"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:ef7800d98b71197aac45a4115c49d2ed27f3cff4e13553a622ea4f97f7d96d4b
!! source digest: sha256:59a43b0f19a6177d8866b3524a34ec9f9b380f29765d4d9647254dba9248b2f1
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/16.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-16-0/server-tools-16-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=16.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 the
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 1a19211

Please sign in to comment.