try to fix db 500 errors on wpd

remotes/1693045480750635534/spooky-22
Aevann1 2022-09-01 21:05:37 +02:00
parent 4ef9a7b58c
commit e5b2675f0d
2 changed files with 2 additions and 2 deletions

View File

@ -354,7 +354,7 @@ def gumroad(v):
procoins = procoins_li[tier] - procoins_li[v.patron]
if procoins < 0: return {"error": f"{patron} rewards already claimed"}, 400
existing = g.db.query(User.id).filter(User.email == v.email, User.is_activated == True, User.patron >= tier).one_or_none()
existing = g.db.query(User.id).filter(User.email == v.email, User.is_activated == True, User.patron >= tier).first()
if existing: return {"error": f"{patron} rewards already claimed on another account"}, 400
v.patron = tier

View File

@ -159,7 +159,7 @@ def vote_comment(comment_id, new, v):
coin_mult = 1
g.db.flush()
g.db.commit()
existing = g.db.query(CommentVote).filter_by(user_id=v.id, comment_id=comment.id).one_or_none()
if DOUBLE_XP_ENABLED > 0: