From a46d7fe95c58933d73bdc118dbd62b5403ff32e2 Mon Sep 17 00:00:00 2001 From: io Date: Fri, 11 Jun 2021 21:37:09 +0000 Subject: [PATCH] SQL NULL a fuck --- functions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions.py b/functions.py index 36cbfdb..0209dc3 100755 --- a/functions.py +++ b/functions.py @@ -20,7 +20,7 @@ def make_sentence(output, cfg): c = db.cursor() if cfg['learn_from_cw']: ignored_cws_query_params = "(" + ",".join("?" * len(cfg["ignored_cws"])) + ")" - toots = c.execute(f"SELECT content FROM `toots` WHERE cw NOT IN {ignored_cws_query_params} ORDER BY RANDOM() LIMIT 10000", cfg["ignored_cws"]).fetchall() + toots = c.execute(f"SELECT content FROM `toots` WHERE cw IS NULL OR CW NOT IN {ignored_cws_query_params} ORDER BY RANDOM() LIMIT 10000", cfg["ignored_cws"]).fetchall() else: toots = c.execute("SELECT content FROM `toots` WHERE cw IS NULL ORDER BY RANDOM() LIMIT 10000").fetchall()