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 = {