Skip to content

Commit

Permalink
tabedit: Save empty inputs as NULL
Browse files Browse the repository at this point in the history
  • Loading branch information
ewie committed May 7, 2021
1 parent 4e8c464 commit 9287fc2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/gws/ext/action/tabedit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9287fc2

Please sign in to comment.