Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
interaction='download',
user=flask_login.current_user,
event=event,
submission=submission,
submission_file=submission_file
)
return send_from_directory(
submission_abspath, f_name, as_attachment=True,
attachment_filename='{}_{}'.format(submission.hash_[:6], f_name),
mimetype='application/octet-stream'
)
# Importing selected files into sandbox
choices = [(f, f) for f in submission.f_names]
import_form = ImportForm()
import_form.selected_f_names.choices = choices
if import_form.validate_on_submit():
sandbox_submission = get_submission_by_name(
db.session, event.name, flask_login.current_user.name,
event.ramp_sandbox_name
)
for filename in import_form.selected_f_names.data:
logger.info(
'{} is importing {}/{}/{}/{}'
.format(flask_login.current_user.name, event, team,
submission, filename)
)
# TODO: deal with different extensions of the same file
src = os.path.join(submission.path, filename)
dst = os.path.join(sandbox_submission.path, filename)