Commit Graph

5 Commits

Author SHA1 Message Date
Katie Smith
72be10c681 Add JSON schema for updating template
We did not have a JSON schema for updating a template. Since we will
remove the postage constraint from the templates table, this adds a JSON
schema for updating a template so that we can use it to check that the
postage is one of the allowed values.
2020-06-19 08:59:27 +01:00
Katie Smith
15112b2148 Update post_create_template_schema
Updated the `post_create_template_schema` to check that the postage is
one of our allowed values.
2020-06-19 08:59:27 +01:00
Pea Tyczynska
19f7678b05 Don't allow to set postage per template if no service permission 2018-12-21 16:37:52 +00:00
Rebecca Law
4849ecdf63 Update the template_schema to include a parent_folder_id.
When creating the Tempalte from_json, the folder is passed in. Since some validation should done, as in the folder exists and is for the same service, the folder is passed through to the Tempalte.from_json method.
When the template is persisted so is the relationship to folders.
TODO: If the folder is invalid a specific message should be returned.
2018-11-07 16:17:09 +00:00
Rebecca Law
39198ed67e Using jsonschema for create_template.
Updated jsonschema to Draft7, this allowed a conditional validation on subject, if template_type == 'email' or 'letter' then subject is required.
This version is backward compatible with Draft4.
When creating TempalteRedacted, I've built the dict depending on if the created_by or created_by_id exists.
2018-11-07 16:17:08 +00:00