diff --git a/app/listmonk/tasks.py b/app/listmonk/tasks.py index c3d279a..0ac5d78 100644 --- a/app/listmonk/tasks.py +++ b/app/listmonk/tasks.py @@ -24,6 +24,12 @@ def send_week(): week, archive = models.Item.public(now) week_obj = models.Week.objects.filter(monday=monday).first() notified_key = "week-%s-notified" % monday + monday_dt = timezone.make_aware( + timezone.datetime.strptime(monday, '%Y-%m-%d'), + timezone.get_default_timezone() + ) + if not week.filter(announced__gt=monday_dt).count(): + return if not week_obj: if not cache.get(notified_key): message = "no title for week, can not send out email please add: %s/admin/item/week/add/?monday=%s" % (settings.URL, monday)