Don’t require template when content is provided

So that the admin app can create broadcasts without a template it needs
to be allowed to create broadcasts from content instead.
This commit is contained in:
Chris Hill-Scott
2021-01-15 14:35:23 +00:00
parent 01504ed760
commit 0510311d63
3 changed files with 57 additions and 17 deletions

View File

@@ -15,8 +15,13 @@ create_broadcast_message_schema = {
'finishes_at': {'type': 'string', 'format': 'datetime'},
'areas': {"type": "array", "items": {"type": "string"}},
'simple_polygons': {"type": "array", "items": {"type": "array"}},
'content': {'type': 'string', 'minLength': 1, 'maxLength': 1395},
},
'required': ['template_id', 'service_id', 'created_by'],
'required': ['service_id', 'created_by'],
'oneOf': [
{'required': ['template_id']},
{'required': ['content']},
],
'additionalProperties': False
}