skip if there are no items for the week at all

This commit is contained in:
j 2025-05-18 14:58:22 +01:00
commit f99fae269d

View file

@ -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)