don't fail if week does not exist yet
This commit is contained in:
parent
1f9676fdab
commit
2d91dfcacb
1 changed files with 5 additions and 4 deletions
|
@ -24,7 +24,8 @@ def send_week():
|
||||||
week, archive = models.Item.public(now)
|
week, archive = models.Item.public(now)
|
||||||
week_obj = models.Week.objects.filter(monday=monday).first()
|
week_obj = models.Week.objects.filter(monday=monday).first()
|
||||||
notified_key = "week-%s-notified" % monday
|
notified_key = "week-%s-notified" % monday
|
||||||
if not week_obj and not cache.get(notified_key):
|
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)
|
message = "no title for week, can not send out email please add: %s/admin/item/week/add/?monday=%s" % (settings.URL, monday)
|
||||||
r = rpc.send(message, group=settings.SIGNAL_MODERATORS_GROUP)
|
r = rpc.send(message, group=settings.SIGNAL_MODERATORS_GROUP)
|
||||||
cache.set(notified_key, True, 24*60*60)
|
cache.set(notified_key, True, 24*60*60)
|
||||||
|
|
Loading…
Reference in a new issue