gdfdfg
This commit is contained in:
parent
6f0eae31b5
commit
8674d4f4c7
6 changed files with 11 additions and 11 deletions
|
@ -1254,10 +1254,10 @@ def save_post(pid, v):
|
|||
|
||||
post=get_post(pid)
|
||||
|
||||
save = g.db.query(SaveRelationship).filter_by(user_id=v.id, submission_id=post.id, type=1).one_or_none()
|
||||
save = g.db.query(SaveRelationship).filter_by(user_id=v.id, submission_id=post.id).one_or_none()
|
||||
|
||||
if not save:
|
||||
new_save=SaveRelationship(user_id=v.id, submission_id=post.id, type=1)
|
||||
new_save=SaveRelationship(user_id=v.id, submission_id=post.id)
|
||||
g.db.add(new_save)
|
||||
g.db.commit()
|
||||
|
||||
|
@ -1270,7 +1270,7 @@ def unsave_post(pid, v):
|
|||
|
||||
post=get_post(pid)
|
||||
|
||||
save = g.db.query(SaveRelationship).filter_by(user_id=v.id, submission_id=post.id, type=1).one_or_none()
|
||||
save = g.db.query(SaveRelationship).filter_by(user_id=v.id, submission_id=post.id).one_or_none()
|
||||
|
||||
if save:
|
||||
g.db.delete(save)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue