From 2e8d16d7b079f99f1efeecf89664f388d56875b8 Mon Sep 17 00:00:00 2001 From: "Jannis M. Hoffmann" Date: Sun, 10 Nov 2024 17:27:30 +0100 Subject: made password in config optional for sqlite use more sqlite like replace query --- src/jwebmail/__init__.py | 2 +- src/jwebmail/read_mails.py | 4 ++-- 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: -- cgit v1.2.3