Improved Python init format.

This commit is contained in:
Ben Rog-Wilhelm 2023-04-22 05:11:15 -05:00
parent 576bf6bb89
commit 9068c5e034

View file

@ -40,13 +40,14 @@ def cron_setup():
for label, ref in hardcoded_cron_jobs.items(): for label, ref in hardcoded_cron_jobs.items():
print(f"Cron: Creating {label}") print(f"Cron: Creating {label}")
task = PythonCodeTask() task: PythonCodeTask = PythonCodeTask(
task.label = label label = label,
task.author_id = AUTOJANNY_ID author_id = AUTOJANNY_ID,
task.frequency_day = ref["frequency_day"] frequency_day = ref["frequency_day"],
task.time_of_day_utc = ref["time_of_day_utc"] time_of_day_utc = ref["time_of_day_utc"],
task.import_path = ref["import_path"] import_path = ref["import_path"],
task.callable = ref["callable"] callable = ref["callable"],
)
db.add(task) db.add(task)
db.commit() db.commit()