Do not show postage stamp for letter preview

This commit is contained in:
David McDonald
2019-10-09 13:47:28 +01:00
parent fdf74572b9
commit 9ba1dbfffa
3 changed files with 9 additions and 7 deletions

View File

@@ -775,7 +775,9 @@ class LetterUploadPostageForm(StripWhitespaceForm):
default='second',
validators=[DataRequired()]
)
file_id = HiddenField()
file_id = HiddenField(
validators=[DataRequired()]
)
class ForgotPasswordForm(StripWhitespaceForm):

View File

@@ -153,6 +153,10 @@ def uploaded_letter_preview(service_id, file_id):
error = get_letter_validation_error(error_message, invalid_pages, page_count)
template_dict = service_api_client.get_precompiled_template(service_id)
# Override pre compiled letter template postage to none as it has not yet been picked even though
# the pre compiled letter template has its postage set as second class as the DB currently requires
# a non null value of postage for letter templates
template_dict['postage'] = None
form = LetterUploadPostageForm()