From 606bf2c4bea5562c2a51d98829ceb668afabae99 Mon Sep 17 00:00:00 2001 From: clearml <> Date: Thu, 5 Dec 2024 22:25:35 +0200 Subject: [PATCH] Fix mongodb connection when overridden connection string contains connection options --- apiserver/database/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apiserver/database/__init__.py b/apiserver/database/__init__.py index 401034f..57dc526 100644 --- a/apiserver/database/__init__.py +++ b/apiserver/database/__init__.py @@ -81,7 +81,7 @@ class DatabaseFactory: entry = cls._create_db_entry(alias=alias, settings=db_entries.get(key)) if override_connection_string: - con_str = f"{override_connection_string.rstrip('/')}/{key}" + con_str = furl(override_connection_string).add(path=key).url log.info(f"Using override mongodb connection string for {alias}: {con_str}") entry.host = con_str else: