fix: [paste_submit UI] filter empty file field

pull/422/head
Terrtia 2019-06-05 16:18:30 +02:00
parent 9cb6312279
commit 1929b2c6a7
No known key found for this signature in database
GPG Key ID: 1E1B1F50D84613D0
1 changed files with 7 additions and 3 deletions

View File

@ -294,6 +294,12 @@ def submit():
ltagsgalaxies = request.form['tags_galaxies'] ltagsgalaxies = request.form['tags_galaxies']
paste_content = request.form['paste_content'] paste_content = request.form['paste_content']
is_file = False
file = request.files['file']
if file:
if file.filename:
is_file = True
submitted_tag = 'infoleak:submission="manual"' submitted_tag = 'infoleak:submission="manual"'
#active taxonomies #active taxonomies
@ -312,9 +318,7 @@ def submit():
else: else:
ltags = submitted_tag ltags = submitted_tag
if 'file' in request.files: if is_file:
file = request.files['file']
if file: if file:
if file and allowed_file(file.filename): if file and allowed_file(file.filename):