Skip to content
Snippets Groups Projects
Commit 283fbca9 authored by Patrick Jentsch's avatar Patrick Jentsch
Browse files

Codestyle

parent cdb352f1
Branches
Tags
No related merge requests found
...@@ -30,9 +30,8 @@ class AddNLPJobForm(FlaskForm): ...@@ -30,9 +30,8 @@ class AddNLPJobForm(FlaskForm):
def validate_files(form, field): def validate_files(form, field):
for file in field.data: for file in field.data:
if not file.filename.lower().endswith('.txt'): if not file.filename.lower().endswith('.txt'):
raise ValidationError( raise ValidationError('File does not have an approved '
'File does not have an approved extension: .txt' 'extension: .txt')
)
class AddOCRJobForm(FlaskForm): class AddOCRJobForm(FlaskForm):
...@@ -62,10 +61,8 @@ class AddOCRJobForm(FlaskForm): ...@@ -62,10 +61,8 @@ class AddOCRJobForm(FlaskForm):
def validate_files(form, field): def validate_files(form, field):
for file in field.data: for file in field.data:
if not file.filename.lower().endswith(('.pdf', '.tif', '.tiff')): if not file.filename.lower().endswith(('.pdf', '.tif', '.tiff')):
raise ValidationError( raise ValidationError('File does not have an approved '
'File does not have an approved extension: ' 'extension: .pdf | .tif | .tiff')
'.pdf | .tif | .tiff'
)
class AddSetupFilesJobForm(FlaskForm): class AddSetupFilesJobForm(FlaskForm):
...@@ -82,7 +79,6 @@ class AddSetupFilesJobForm(FlaskForm): ...@@ -82,7 +79,6 @@ class AddSetupFilesJobForm(FlaskForm):
for file in field.data: for file in field.data:
if not file.filename.lower().endswith(('.jpeg', '.jpg', '.png', if not file.filename.lower().endswith(('.jpeg', '.jpg', '.png',
'.tiff', '.tif')): '.tiff', '.tif')):
raise ValidationError( raise ValidationError('File does not have an approved '
'File does not have an approved extension: ' 'extension: .jpeg | .jpg | .png | .tiff '
'.jpeg | .jpg | .png | .tiff | .tif' '| .tif')
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment