def delete_like(user_obj, user_checkpoint_obj): """ Deletes a like record between a user and a Checkpoint if it exists """ from db import db, Notification like_obj = get_like_w_attr(user_obj, user_checkpoint_obj.checkpoint) if not like_obj is None: delete_notifications_w_relevance("new_like", like_obj.id) db.session.delete(like_obj) db.session.commit()
def del_comment(id): """ Deletes the <<Comment>> object given its id from the database """ from db import db, Comment comment = get_comment(id) db.session.delete(comment) db.commit() delete_notifications_w_relevance("new_comment", id)