This is an automated email from the ASF dual-hosted git repository.
humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git
The following commit(s) were added to refs/heads/master by this push:
new b47565f If url_prefix is erroneously set to None, replace with empty
string
b47565f is described below
commit b47565f5c97122599718b71c07b877c931f802b4
Author: Daniel Gruno <[email protected]>
AuthorDate: Fri Nov 20 14:15:06 2020 +0100
If url_prefix is erroneously set to None, replace with empty string
This is to prevent the elastic library from failing when url_prefix is
None, which incurs a TypeError while trying to concat URL+prefix
---
server/plugins/background.py | 4 ++--
server/plugins/database.py | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/server/plugins/background.py b/server/plugins/background.py
index 5e9e3e9..d7418fb 100644
--- a/server/plugins/background.py
+++ b/server/plugins/background.py
@@ -45,7 +45,7 @@ async def get_lists(database: plugins.configuration.DBConfig)
-> dict:
{
"host": database.hostname,
"port": database.port,
- "url_prefix": database.url_prefix,
+ "url_prefix": database.url_prefix or "",
"use_ssl": database.secure,
},
]
@@ -100,7 +100,7 @@ async def get_public_activity(database:
plugins.configuration.DBConfig) -> dict:
{
"host": database.hostname,
"port": database.port,
- "url_prefix": database.url_prefix,
+ "url_prefix": database.url_prefix or "",
"use_ssl": database.secure,
},
]
diff --git a/server/plugins/database.py b/server/plugins/database.py
index 6719771..f033a35 100644
--- a/server/plugins/database.py
+++ b/server/plugins/database.py
@@ -54,7 +54,7 @@ class Database:
{
"host": config.hostname,
"port": config.port,
- "url_prefix": config.url_prefix,
+ "url_prefix": config.url_prefix or "",
"use_ssl": config.secure,
},
]