diff --git a/src/schedule/models/schedule_entry.py b/src/schedule/models/schedule_entry.py index 8ad6a2d9..f862d666 100644 --- a/src/schedule/models/schedule_entry.py +++ b/src/schedule/models/schedule_entry.py @@ -1,7 +1,7 @@ import sys from itertools import count -from django.core.validators import MaxValueValidator, MinValueValidator +from django.core.validators import MaxValueValidator, MinValueValidator, ValidationError from django.db import models import actions @@ -157,9 +157,11 @@ def __init__(self, *args, **kwargs): if self.next_task_time is None: self.next_task_time = self.start - # used by .save to detect whether to reset .next_task_time + # used by .save to detect whether to reset .next_task_times self.__start = self.start self.__interval = self.interval + if self.action not in actions.registered_actions: + raise ValidationError(self.action + ' does not exist') def update(self, *args, **kwargs): super(ScheduleEntry, self).update(*args, **kwargs)