Fix disabled discussions detection

This commit is contained in:
Frisk 2020-11-20 21:39:25 +01:00
parent eb899fdd39
commit 201c1d407d
No known key found for this signature in database
GPG key ID: 213F7C15068AF8AC

View file

@ -348,7 +348,7 @@ async def discussion_handler():
try: try:
while True: while True:
fetch_all = db_cursor.execute( fetch_all = db_cursor.execute(
'SELECT wiki, wikiid, rcid, postid FROM rcgcdw WHERE postid > -1') "SELECT wiki, rcid, postid FROM rcgcdw WHERE postid != '-1'")
for db_wiki in fetch_all.fetchall(): for db_wiki in fetch_all.fetchall():
header = settings["header"] header = settings["header"]
header["Accept"] = "application/hal+json" header["Accept"] = "application/hal+json"
@ -395,7 +395,7 @@ async def discussion_handler():
DBHandler.update_db() DBHandler.update_db()
continue continue
comment_events = [] comment_events = []
targets = generate_targets(db_wiki["wiki"], "AND NOT postid = -1") targets = generate_targets(db_wiki["wiki"], "AND NOT postid = '-1'")
for post in discussion_feed: for post in discussion_feed:
if post["_embedded"]["thread"][0]["containerType"] == "ARTICLE_COMMENT" and post["id"] > db_wiki["postid"]: if post["_embedded"]["thread"][0]["containerType"] == "ARTICLE_COMMENT" and post["id"] > db_wiki["postid"]:
comment_events.append(post["forumId"]) comment_events.append(post["forumId"])