Mercurial > farol > farol
comparison farol/main.py @ 131:75c053bf2c3a
Remove pointless check if the uploaded file ends in .xml
author | Benoît Allard <benoit.allard@greenbone.net> |
---|---|
date | Fri, 24 Oct 2014 10:53:37 +0200 |
parents | 67c4b299736e |
children | 3a56d5501ffa |
comparison
equal
deleted
inserted
replaced
130:5b47af23547f | 131:75c053bf2c3a |
---|---|
160 return redirect(url_for('new')) | 160 return redirect(url_for('new')) |
161 elif 'url' in request.form: | 161 elif 'url' in request.form: |
162 set_url(request.form['url']) | 162 set_url(request.form['url']) |
163 elif 'local' in request.files: | 163 elif 'local' in request.files: |
164 upload = request.files['local'] | 164 upload = request.files['local'] |
165 if not upload.filename.endswith('.xml'): | |
166 flash('Uploaded files should end in .xml', 'danger') | |
167 return redirect(url_for('new')) | |
168 fpath = os.path.join(app.instance_path, 'tmp', | 165 fpath = os.path.join(app.instance_path, 'tmp', |
169 secure_filename(upload.filename)) | 166 secure_filename(upload.filename)) |
170 if not os.path.exists(os.path.dirname(fpath)): | 167 if not os.path.exists(os.path.dirname(fpath)): |
171 os.makedirs(os.path.dirname(fpath)) | 168 os.makedirs(os.path.dirname(fpath)) |
172 upload.save(fpath) | 169 upload.save(fpath) |