From 0e280c22725049cdf90c4174c2771b315db7d7e3 Mon Sep 17 00:00:00 2001 From: baoliang Date: Thu, 19 Nov 2020 00:34:52 +0800 Subject: [PATCH] add message --- polls/tasks.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/polls/tasks.py b/polls/tasks.py index 9eba6fa..a7c793a 100644 --- a/polls/tasks.py +++ b/polls/tasks.py @@ -15,15 +15,13 @@ def process_notify_task(): now = datetime.now() if two_hours_later < now: phone = n.user.username - print(phone) today = now.date() hour = now.hour exists = SMSNotifyRecord.objects.filter( phone=phone, added=today, notice_id=n.id).exists() - print(exists) if exists: break - if hour < 8 or hour > 24: + if hour < 8 or hour > 20: break print('============', phone, n.type, n.id) SMSNotifyRecord.objects.create(phone=phone, notice_id=n.id)