From 864e035b90881a3314fa05a2c02b1d55a8f08923 Mon Sep 17 00:00:00 2001 From: hole-thu Date: Wed, 9 Sep 2020 19:16:30 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=84=E8=AE=BA=E4=BD=BF=E7=94=A8=E6=A0=87?= =?UTF-8?q?=E8=AE=B0=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hole.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hole.py b/hole.py index 18b6635..282abb0 100644 --- a/hole.py +++ b/hole.py @@ -47,7 +47,7 @@ def login(): elif provider == 'thuhole': token = request.args.get('token') try: - rt = 'hole_thu login: ' + ''.join(random.choices(string.ascii_letters + string.digits, k=16)) + rt = ''.join(random.choices(string.ascii_letters + string.digits, k=16)) headers = { 'user-agent': 'holeBot; hole.thu.monster', 'host': app.config.get('THUHOLE_HOST') @@ -376,7 +376,9 @@ def delete(): if len(obj.comments): abort(403) Attention.query.filter_by(pid=obj.id).delete() TagRecord.query.filter_by(pid=obj.id).delete() - db.session.delete(obj) + db.session.delete(obj) + else: + obj.deleted = True elif u.name in app.config.get('ADMINS'): obj.deleted = True db.session.add(Syslog(