remotes/1693045480750635534/spooky-22
Aevann1 2021-10-06 01:51:37 +02:00
parent 06d45a2277
commit 5f5659cc55
1 changed files with 4 additions and 2 deletions

View File

@ -63,8 +63,10 @@ class Comment(Base):
return f"<Comment(id={self.id})>"
def poll_voted(self, v):
vote = g.db.query(CommentVote).options(lazyload('*')).filter_by(user_id=v.id, comment_id=self.id).first()
if vote: return vote.vote_type
if v:
vote = g.db.query(CommentVote).options(lazyload('*')).filter_by(user_id=v.id, comment_id=self.id).first()
if vote: return vote.vote_type
else: return None
else: return None
@property