2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-01 11:10:54 +00:00

Add a task which fails on purpose

This commit is contained in:
Oliver Walters
2022-01-07 17:04:33 +11:00
parent 36feef6558
commit c04e07c1fa
3 changed files with 17 additions and 10 deletions

View File

@ -102,16 +102,16 @@ class ScheduleMixin:
"""
if not self.has_scheduled_tasks:
raise ValueError(f"SCHEDULED_TASKS not defined")
raise ValueError("SCHEDULED_TASKS not defined")
for key, task in self.scheduled_tasks.items():
if 'func' not in task:
raise ValueError(f"Task '{key}' is missing 'func' parameter")
if 'schedule' not in task:
raise ValueError(f"Task '{key}' is missing 'schedule' parameter")
schedule = task['schedule'].upper().strip()
if schedule not in self.ALLOWABLE_SCHEDULE_TYPES:
@ -153,7 +153,6 @@ class ScheduleMixin:
minutes=task.get('minutes', None),
repeats=task.get('repeats', -1),
)
def unregister_tasks(self):
"""