You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by hu...@apache.org on 2021/03/28 18:39:37 UTC

[incubator-ponymail-foal] branch master updated: Fix mypy warnings

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 35dd9c0  Fix mypy warnings
35dd9c0 is described below

commit 35dd9c0a15bcb6823e447eacd49d6c5d6a52be0a
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Sun Mar 28 20:37:22 2021 +0200

    Fix mypy warnings
---
 server/plugins/database.py | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/server/plugins/database.py b/server/plugins/database.py
index 32aef47..87149ce 100644
--- a/server/plugins/database.py
+++ b/server/plugins/database.py
@@ -49,19 +49,19 @@ class Database:
         self.config = config
         self.uuid = str(uuid.uuid4())
         self.dbs = DBNames(config.db_prefix)
-        dburl = self.config.dburl
-        if not dburl:
-            dburl = {
-                "host": config.hostname,
-                "port": config.port,
-                "url_prefix": config.url_prefix or "",
-                "use_ssl": config.secure,
-            }
-        self.client = elasticsearch.AsyncElasticsearch(
+        if self.config.dburl:
+            self.client = elasticsearch.AsyncElasticsearch([dburl,])
+        else:
+            self.client = elasticsearch.AsyncElasticsearch(
             [
-                dburl
+                {
+                    "host": config.hostname,
+                    "port": config.port,
+                    "url_prefix": config.url_prefix or "",
+                    "use_ssl": config.secure,
+                },
             ]
-        )
+            )
 
     async def search(self, index="", **kwargs):
         if not index: