Merge pull request #2662 from alphagov/utils-bump

Utils bump
This commit is contained in:
Leo Hemsted
2019-11-19 10:55:07 +00:00
committed by Rebecca Law
11 changed files with 150 additions and 41 deletions

View File

@@ -11,6 +11,9 @@ from app.v2.template.template_schemas import post_template_preview_request, crea
@v2_template_blueprint.route("/<template_id>/preview", methods=['POST'])
def post_template_preview(template_id):
if not request.content_type or request.content_type != 'application/json':
raise BadRequestError(message="Content-Type header is not set to application/json.",
status_code=400)
_data = request.get_json()
if _data is None:
_data = {}