Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
nopaque
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Looking for advice? Join the
Matrix channel for GitLab users in Bielefeld
!
Show more breadcrumbs
SFB 1288 - INF
nopaque
Commits
283fbca9
Commit
283fbca9
authored
5 years ago
by
Patrick Jentsch
Browse files
Options
Downloads
Patches
Plain Diff
Codestyle
parent
cdb352f1
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/jobs/forms.py
+7
-11
7 additions, 11 deletions
app/jobs/forms.py
with
7 additions
and
11 deletions
app/jobs/forms.py
+
7
−
11
View file @
283fbca9
...
@@ -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
'
)
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment