fdfd
This commit is contained in:
parent
e7651b7968
commit
ee1cc1d7e4
1 changed files with 2 additions and 2 deletions
|
@ -71,7 +71,7 @@ def api_vote_post(post_id, new, v):
|
|||
# check for existing vote
|
||||
existing = g.db.query(Vote).filter_by(user_id=v.id, submission_id=post.id).first()
|
||||
|
||||
if existing.vote_type == new: return "", 204
|
||||
if existing and existing.vote_type == new: return "", 204
|
||||
|
||||
if existing:
|
||||
if existing.vote_type == 0 and new != 0:
|
||||
|
@ -121,7 +121,7 @@ def api_vote_comment(comment_id, new, v):
|
|||
# check for existing vote
|
||||
existing = g.db.query(CommentVote).filter_by(user_id=v.id, comment_id=comment.id).first()
|
||||
|
||||
if existing.vote_type == new: return "", 204
|
||||
if existing and existing.vote_type == new: return "", 204
|
||||
|
||||
if existing:
|
||||
if existing.vote_type == 0 and new != 0:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue