remove entries for users no longer found on pnut.io
Some checks failed
thrrgilag/partybot/pipeline/head This commit looks good
git.dreamfall.space/partybot/pipeline/head There was a failure building this commit

This commit is contained in:
Morgan McMillian 2023-11-19 16:36:30 -08:00
parent b0ad45e935
commit 2a05edf78d

View file

@ -159,7 +159,13 @@ def karma(room):
reply += user.username + ": " + str(entry.karma) + "\n"
except pnutpy.errors.PnutMissing:
continue
del_karma = Karma.query.filter(Karma.userid == entry.userid).one_or_none()
if del_karma:
db_session.delete(del_karma)
del_counter = MdnpRequests.query.filter(MdnpRequests.userid == entry.userid).one_or_none()
if del_counter:
db_session.delete(del_counter)
db_session.commit()
send(room, reply)
def chimpnut(msg):