This commit is contained in:
Aevann1 2022-02-14 21:02:05 +02:00
parent 4d9815210c
commit 1c84399650
5 changed files with 29 additions and 19 deletions

View file

@ -1003,10 +1003,10 @@ def save_comment(cid, v):
comment=get_comment(cid)
save=g.db.query(SaveRelationship).filter_by(user_id=v.id, comment_id=comment.id).one_or_none()
save=g.db.query(CommentSaveRelationship).filter_by(user_id=v.id, comment_id=comment.id).one_or_none()
if not save:
new_save=SaveRelationship(user_id=v.id, comment_id=comment.id)
new_save=CommentSaveRelationship(user_id=v.id, comment_id=comment.id)
g.db.add(new_save)
try: g.db.commit()
@ -1021,7 +1021,7 @@ def unsave_comment(cid, v):
comment=get_comment(cid)
save=g.db.query(SaveRelationship).filter_by(user_id=v.id, comment_id=comment.id).one_or_none()
save=g.db.query(CommentSaveRelationship).filter_by(user_id=v.id, comment_id=comment.id).one_or_none()
if save:
g.db.delete(save)