summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJannis M. Hoffmann <jannis@fehcom.de>2024-11-10 17:27:30 +0100
committerJannis M. Hoffmann <jannis@fehcom.de>2024-11-10 17:27:30 +0100
commit2e8d16d7b079f99f1efeecf89664f388d56875b8 (patch)
tree484bdbd59cad54d382549de4817ff88d2252bd04
parented9d952d882ce8313dc4cb5049ca352f5b90a0c4 (diff)
made password in config optional for sqlite
use more sqlite like replace query
-rw-r--r--src/jwebmail/__init__.py2
-rw-r--r--src/jwebmail/read_mails.py4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/jwebmail/__init__.py b/src/jwebmail/__init__.py
index 04b9e2a..25681d1 100644
--- a/src/jwebmail/__init__.py
+++ b/src/jwebmail/__init__.py
@@ -36,7 +36,7 @@ else:
toml_read_file = dict(load=toml_load, text=True)
-__version__ = "2.4.0.dev2"
+__version__ = "2.4.0.dev3"
csrf = CSRFProtect()
diff --git a/src/jwebmail/read_mails.py b/src/jwebmail/read_mails.py
index 324b4d0..b7e5984 100644
--- a/src/jwebmail/read_mails.py
+++ b/src/jwebmail/read_mails.py
@@ -92,7 +92,7 @@ class SqliteTimeoutSession:
def set(self, key, value):
with closing(self.conn.cursor()) as cur:
cur.execute(
- "REPLACE INTO session VALUES (?, ?, unixepoch('now', format('%d seconds', ?)))",
+ "INSERT OR REPLACE INTO session VALUES (?, ?, unixepoch('now', format('%d seconds', ?)))",
[key, value, self.timeout],
)
self.conn.commit()
@@ -117,7 +117,7 @@ def select_timeout_session():
session_type = current_app.config["JWEBMAIL"]["READ_MAILS"]["SESSION_TYPE"]
user = "jwebmail"
- passwd = current_app.config["JWEBMAIL"]["READ_MAILS"]["SESSION_STORE_PASSWD"]
+ passwd = current_app.config["JWEBMAIL"]["READ_MAILS"].get("SESSION_STORE_PASSWD")
args = dict()
db_name = current_app.config["JWEBMAIL"]["READ_MAILS"].get("SESSION_STORE_DB_NAME")
if db_name: