diff --git a/smash/web/views/kit.py b/smash/web/views/kit.py index d41cd8bda238ac44fc2f34b5f325bf31979258d1..374285be96003b08b48a4c330701e03a362ae330 100644 --- a/smash/web/views/kit.py +++ b/smash/web/views/kit.py @@ -235,12 +235,16 @@ def kit_requests_send_mail(request, start_date, end_date=None): class KitRequestEmailSendJob(CronJobBase): RUN_AT = [] - times = ConfigurationItem.objects.get( - type=KIT_EMAIL_HOUR_CONFIGURATION_TYPE).value.split(";") - for entry in times: - # TODO it's a hack assuming that we are in CEST - text = str((int(entry.split(":")[0]) + 22) % 24) + ":" + entry.split(":")[1] - RUN_AT.append(text) + + try: + times = ConfigurationItem.objects.get( + type=KIT_EMAIL_HOUR_CONFIGURATION_TYPE).value.split(";") + for entry in times: + # TODO it's a hack assuming that we are in CEST + text = str((int(entry.split(":")[0]) + 22) % 24) + ":" + entry.split(":")[1] + RUN_AT.append(text) + except: + logger.error("Cannot fetch data about email hour") schedule = Schedule(run_at_times=RUN_AT) code = 'web.kit_request_weekly_email' # a unique code