Skip to content
Snippets Groups Projects
Commit 0aa8b2a1 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

catch exception that could happen during migration

parent 9c521b80
No related branches found
No related tags found
1 merge request!240Redcap sync
Pipeline #25337 passed
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment