From 146b5f012b6e4ee20a5dc44507880487112d02ae Mon Sep 17 00:00:00 2001 From: ngfchl Date: Wed, 2 Nov 2022 15:16:59 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B7=9F=E9=9A=8F=E5=AD=A6=E6=A0=A1=E5=8D=87?= =?UTF-8?q?=E7=BA=A7=E4=BA=8C=E5=8D=87=E7=BA=A7=E9=83=A8=E5=88=86=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=EF=BC=8C=E7=9B=AE=E5=89=8D=E6=97=A0=E6=B3=95=E7=AA=81?= =?UTF-8?q?=E7=A0=B4CF=E4=BA=8C=E4=BB=A3=E7=9B=BE=EF=BC=8C=E6=9A=82?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E7=AD=BE=E5=88=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- auto_pt/views.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/auto_pt/views.py b/auto_pt/views.py index d577d70..a382803 100644 --- a/auto_pt/views.py +++ b/auto_pt/views.py @@ -369,8 +369,9 @@ def do_update(request): try: logger.info('开始更新') bt_school = Site.objects.filter(url=' http://47.242.110.63/').first() - bt_school.url = 'https://pt.btschool.club/' - bt_school.save() + if not bt_school: + bt_school.url = 'https://pt.btschool.club/' + bt_school.save() pt_site_site_mtime = os.stat('pt_site_site.json').st_mtime requirements_mtime = os.stat('requirements.txt').st_mtime update_commands = {