mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-11 15:52:21 -05:00
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:
@@ -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',
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user