add message
This commit is contained in:
parent
a240ba852b
commit
0e280c2272
|
@ -15,15 +15,13 @@ def process_notify_task():
|
||||||
now = datetime.now()
|
now = datetime.now()
|
||||||
if two_hours_later < now:
|
if two_hours_later < now:
|
||||||
phone = n.user.username
|
phone = n.user.username
|
||||||
print(phone)
|
|
||||||
today = now.date()
|
today = now.date()
|
||||||
hour = now.hour
|
hour = now.hour
|
||||||
exists = SMSNotifyRecord.objects.filter(
|
exists = SMSNotifyRecord.objects.filter(
|
||||||
phone=phone, added=today, notice_id=n.id).exists()
|
phone=phone, added=today, notice_id=n.id).exists()
|
||||||
print(exists)
|
|
||||||
if exists:
|
if exists:
|
||||||
break
|
break
|
||||||
if hour < 8 or hour > 24:
|
if hour < 8 or hour > 20:
|
||||||
break
|
break
|
||||||
print('============', phone, n.type, n.id)
|
print('============', phone, n.type, n.id)
|
||||||
SMSNotifyRecord.objects.create(phone=phone, notice_id=n.id)
|
SMSNotifyRecord.objects.create(phone=phone, notice_id=n.id)
|
||||||
|
|
Loading…
Reference in New Issue