Introduce validation and error handling for validation preview

This commit is contained in:
Pea Tyczynska
2018-09-27 17:55:18 +01:00
parent 3be129241f
commit 3cdacaaf0a
2 changed files with 16 additions and 7 deletions

View File

@@ -769,7 +769,10 @@ class ServiceUpdateEmailBranding(StripWhitespaceForm):
class PDFUploadForm(StripWhitespaceForm):
file = FileField_wtf(
'Upload a letter in PDF format to check if it fits in the printable area',
validators=[FileAllowed(['pdf'], 'PDF documents only!')]
validators=[
FileAllowed(['pdf'], 'PDF documents only!'),
DataRequired(message="You need to upload a file to submit")
]
)