Merge pull request #711 from alphagov/extend-scheduling-to-96-hours

Let jobs be scheduled up to 96 hours in the future
This commit is contained in:
Chris Hill-Scott
2016-10-14 15:33:44 +01:00
committed by GitHub
2 changed files with 7 additions and 7 deletions

View File

@@ -39,8 +39,8 @@ def _validate_positive_number(value, msg="Not a positive integer"):
raise ValidationError(msg)
def _validate_datetime_not_more_than_24_hours_in_future(dte, msg="Date cannot be more than 24hrs in the future"):
if dte > datetime.utcnow() + timedelta(hours=24):
def _validate_datetime_not_more_than_96_hours_in_future(dte, msg="Date cannot be more than 96hrs in the future"):
if dte > datetime.utcnow() + timedelta(hours=96):
raise ValidationError(msg)
@@ -227,7 +227,7 @@ class JobSchema(BaseSchema):
@validates('scheduled_for')
def validate_scheduled_for(self, value):
_validate_datetime_not_in_past(value)
_validate_datetime_not_more_than_24_hours_in_future(value)
_validate_datetime_not_more_than_96_hours_in_future(value)
class Meta:
model = models.Job