Fix deleting comments already deleted

master
Noah 2017-01-02 20:04:22 -08:00
父節點 84d5b4a2cd
當前提交 8dbee56b38
共有 1 個檔案被更改,包括 3 行新增2 行删除

查看文件

@ -155,8 +155,9 @@ def update_comment(thread, cid, data):
def delete_comment(thread, cid):
"""Delete a comment from a thread."""
comments = get_comments(thread)
del comments[cid]
write_comments(thread, comments)
if cid in comments:
del comments[cid]
write_comments(thread, comments)
def make_quick_delete_token(thread, cid):