hfg
This commit is contained in:
parent
4d9815210c
commit
1c84399650
5 changed files with 29 additions and 19 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue