From 974415a93a37c0a333e8858c046e81dc476eeb85 Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Thu, 2 Sep 2021 21:57:06 +0200 Subject: [PATCH] fix insert of empty strings --- api/db.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/api/db.py b/api/db.py index 712e5b8..987b8f3 100644 --- a/api/db.py +++ b/api/db.py @@ -51,6 +51,8 @@ def execDatabaseOperation(func, params): with conn: with conn.cursor(cursor_factory = psycopg2.extras.RealDictCursor) as cur: + params["params"] = [ v if not v=='' else None for v in params["params"] ] + logger.debug("edo: {}".format(str(params))) return func(cur, params) except psycopg2.Error as err: raise Exception("Error when connecting to database: {}".format(err))