don't create job if template has been archived

This commit is contained in:
Leo Hemsted
2016-05-23 15:44:56 +01:00
parent c87cce3c91
commit 7801efd5ca
3 changed files with 43 additions and 1 deletions

View File

@@ -381,6 +381,15 @@ class WeekAggregateNotificationStatisticsSchema(ma.Schema):
_validate_positive_number(value)
class UnarchivedTemplateSchema(BaseSchema):
archived = fields.Boolean(required=True)
@validates_schema
def validate_archived(self, data):
if data['archived']:
raise ValidationError('Template has been deleted', 'template')
user_schema = UserSchema()
user_schema_load_json = UserSchema(load_json=True)
service_schema = ServiceSchema()
@@ -413,3 +422,4 @@ from_to_date_schema = FromToDateSchema()
provider_details_schema = ProviderDetailsSchema()
week_aggregate_notification_statistics_schema = WeekAggregateNotificationStatisticsSchema()
day_schema = DaySchema()
unarchived_template_schema = UnarchivedTemplateSchema()