From 9287fc2ae4d2b055cd35f96906071b1eb98bfd03 Mon Sep 17 00:00:00 2001 From: Erik Wienhold Date: Mon, 3 May 2021 16:02:47 +0200 Subject: [PATCH] tabedit: Save empty inputs as NULL --- app/gws/ext/action/tabedit/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/gws/ext/action/tabedit/__init__.py b/app/gws/ext/action/tabedit/__init__.py index 676a0c898..807187bd6 100644 --- a/app/gws/ext/action/tabedit/__init__.py +++ b/app/gws/ext/action/tabedit/__init__.py @@ -160,8 +160,9 @@ def api_save_data(self, req: t.IRequest, p: SaveDataParams) -> SaveDataResponse: uid = None for a, v in zip(p.attributes, rec): - if v is None or v == '': - continue + # Normalize empty inputs to insert NULL into the database. + if v == '': + v = None atts.append(t.Attribute(name=a.name, value=v)) if a.name == tbl.table.key_column: uid = v