forked from rDrama/rDrama
1
0
Fork 0

mute annoying errors

master
Aevann 2023-07-18 13:17:37 +03:00
parent f6f0d4c4c2
commit 649ea49c67
2 changed files with 5 additions and 0 deletions

View File

@ -95,6 +95,8 @@ def post_id(pid, v, anything=None, sub=None):
p.views += 1
g.db.add(p)
try: g.db.flush()
except: g.db.rollback()
if p.new: defaultsortingcomments = 'new'
elif v: defaultsortingcomments = v.defaultsortingcomments

View File

@ -138,6 +138,9 @@ def vote_post_comment(target_id, new, v, cls, vote_cls):
)
g.db.add(vote)
try: g.db.flush()
except: g.db.rollback()
# this is hacky but it works, we should probably do better later
def get_vote_count(dir, real_instead_of_dir):
votes = g.db.query(vote_cls)