From 109418fbe651bd07adbee81968a980313e3a7deb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Felix=20D=C3=B6rre?= Date: Sun, 13 Jan 2019 15:29:08 +0000 Subject: [PATCH] fix sql syntax! --- motion.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/motion.py b/motion.py index c806f7a..6da4a1e 100644 --- a/motion.py +++ b/motion.py @@ -162,7 +162,7 @@ def put_motion(): db = get_db() with db.xact(): t = db.prepare("SELECT CURRENT_TIMESTAMP")()[0][0]; - s = db.prepare("SELECT MAX(\"identifier\") FROM \"motion\" WHERE \"type\"=$1 AND \"host\"=$2 DATE(\"posed\")=DATE(CURRENT_TIMESTAMP)") + s = db.prepare("SELECT MAX(\"identifier\") FROM \"motion\" WHERE \"type\"=$1 AND \"host\"=$2 AND DATE(\"posed\")=DATE(CURRENT_TIMESTAMP)") sr = s(cat, request.host) ident="" if len(sr) == 0 or sr[0][0] is None: -- 2.39.2