add broadcast to template_types and add broadcast_data

had to go through the code and change a few places where we filter on
template types. i specifically didn't worry about jobs or notifications.

Also, add braodcast_data - a json column that might contain arbitrary
broadcast data that we'll figure out as we go. We don't know what it'll
look like, but it should be returned by the API
This commit is contained in:
Leo Hemsted
2020-07-02 12:12:34 +01:00
parent 3954cd0e4a
commit 7ecd7341b0
12 changed files with 45 additions and 22 deletions

View File

@@ -365,7 +365,7 @@ class TemplateSchema(BaseTemplateSchema, UUIDsAsStringsMixin):
@validates_schema
def validate_type(self, data):
if data.get('template_type') in [models.EMAIL_TYPE, models.LETTER_TYPE]:
if data.get('template_type') in {models.EMAIL_TYPE, models.LETTER_TYPE}:
subject = data.get('subject')
if not subject or subject.strip() == '':
raise ValidationError('Invalid template subject', 'subject')
@@ -391,6 +391,7 @@ class TemplateSchemaNoDetail(TemplateSchema):
'template_redacted',
'updated_at',
'version',
'broadcast_data',
)