forked from rDrama/rDrama
fsfs
parent
f724a74687
commit
5fc33e2039
|
@ -896,11 +896,12 @@ def save_comment(cid, v):
|
||||||
|
|
||||||
comment=get_comment(cid)
|
comment=get_comment(cid)
|
||||||
|
|
||||||
new_save=SaveRelationship(user_id=v.id, submission_id=comment.id, type=2)
|
save=g.db.query(SaveRelationship).options(lazyload('*')).filter_by(user_id=v.id, submission_id=comment.id, type=2).first()
|
||||||
|
|
||||||
g.db.add(new_save)
|
if not save:
|
||||||
|
new_save=SaveRelationship(user_id=v.id, submission_id=comment.id, type=2)
|
||||||
g.db.commit()
|
g.db.add(new_save)
|
||||||
|
g.db.commit()
|
||||||
|
|
||||||
return {"message": "Comment saved!"}
|
return {"message": "Comment saved!"}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue