]> WPIA git - motion.git/commitdiff
fix sql syntax!
authorFelix Dörre <et@felixdoerre.de>
Sun, 13 Jan 2019 15:29:08 +0000 (15:29 +0000)
committerFelix Dörre <et@felixdoerre.de>
Sun, 13 Jan 2019 15:29:08 +0000 (15:29 +0000)
motion.py

index c806f7a6a886710037c75ca5a502a2278c2ab7c0..6da4a1e2790bd1694d99f5cc043d7ef475cd9856 100644 (file)
--- 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: