forked from rDrama/rDrama
mute annoying errors
parent
f6f0d4c4c2
commit
649ea49c67
|
@ -95,6 +95,8 @@ def post_id(pid, v, anything=None, sub=None):
|
||||||
|
|
||||||
p.views += 1
|
p.views += 1
|
||||||
g.db.add(p)
|
g.db.add(p)
|
||||||
|
try: g.db.flush()
|
||||||
|
except: g.db.rollback()
|
||||||
|
|
||||||
if p.new: defaultsortingcomments = 'new'
|
if p.new: defaultsortingcomments = 'new'
|
||||||
elif v: defaultsortingcomments = v.defaultsortingcomments
|
elif v: defaultsortingcomments = v.defaultsortingcomments
|
||||||
|
|
|
@ -138,6 +138,9 @@ def vote_post_comment(target_id, new, v, cls, vote_cls):
|
||||||
)
|
)
|
||||||
g.db.add(vote)
|
g.db.add(vote)
|
||||||
|
|
||||||
|
try: g.db.flush()
|
||||||
|
except: g.db.rollback()
|
||||||
|
|
||||||
# this is hacky but it works, we should probably do better later
|
# this is hacky but it works, we should probably do better later
|
||||||
def get_vote_count(dir, real_instead_of_dir):
|
def get_vote_count(dir, real_instead_of_dir):
|
||||||
votes = g.db.query(vote_cls)
|
votes = g.db.query(vote_cls)
|
||||||
|
|
Loading…
Reference in New Issue