From 77ea7c3b014d292f4c94f0283f26fd20c1627e7b Mon Sep 17 00:00:00 2001 From: hole-thu Date: Tue, 8 Sep 2020 15:08:59 +0800 Subject: [PATCH] fix bug --- hole.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hole.py b/hole.py index d707f0e..3ad48ed 100644 --- a/hole.py +++ b/hole.py @@ -196,7 +196,7 @@ def get_comment(): return { 'code': 0, - 'attention': check_attention(hash_name(u.name), pid), + 'attention': check_attention(u.name, pid), 'data': data } @@ -248,6 +248,8 @@ def attention(): at = Attention(name_hash=hash_name(u.name), pid=pid, disabled=True) db.session.add(at) + print(at.disabled, s=='0') + if(at.disabled != (s == '0')): at.disabled = (s == '0') post.likenum += 1 - 2 * int(s == '0');