mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2025-06-12 00:50:40 +00:00
Add form and service
This commit is contained in:
@ -65,3 +65,16 @@ class AddOCRJobForm(FlaskForm):
|
||||
'File does not have an approved extension: '
|
||||
'.pdf | .tif | .tiff'
|
||||
)
|
||||
|
||||
|
||||
class AddMergeImagesJobForm(FlaskForm):
|
||||
files = MultipleFileField('Files', validators=[DataRequired()])
|
||||
|
||||
def validate_files(form, filed):
|
||||
for file in field.data:
|
||||
if not file.filename.lower().endswith(('.jpeg', '.jpg', '.png',
|
||||
'.tiff', '.tif')):
|
||||
raise ValidationError(
|
||||
'File does not have an approved extension: '
|
||||
'.jpeg | .jpg | .png | .tiff | .tif'
|
||||
)
|
||||
|
Reference in New Issue
Block a user