aboutsummaryrefslogtreecommitdiff
path: root/gn3/db
diff options
context:
space:
mode:
authorBonfaceKilz2021-06-02 07:38:53 +0300
committerzsloan2021-06-18 22:08:04 +0000
commit515ac34950db419bd6440afd1393cf41310d1814 (patch)
treeb13d715c7b709caab7365c5e0c9e084480d48d46 /gn3/db
parent07464f44f48895cc31ba2b088d6125e7777e1073 (diff)
downloadgenenetwork3-515ac34950db419bd6440afd1393cf41310d1814.tar.gz
gn3: db: Return None if data and where are empty
Diffstat (limited to 'gn3/db')
-rw-r--r--gn3/db/__init__.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/gn3/db/__init__.py b/gn3/db/__init__.py
index fae4d29..1eb7b12 100644
--- a/gn3/db/__init__.py
+++ b/gn3/db/__init__.py
@@ -36,7 +36,7 @@ def update(conn: Any,
data: Dataclass,
where: Dataclass) -> Optional[int]:
"""Run an UPDATE on a table"""
- if not any(astuple(data) + astuple(where)):
+ if not (any(astuple(data)) and any(astuple(where))):
return None
sql = f"UPDATE {table} SET "
sql += ", ".join(f"{TABLEMAP[table].get(k)} "