Stop checking the session to see if a file’s valid

We’re going to stop storing job metadata in the session. So we can’t
rely on it for checking whether a file is valid. That safeguard is
happening in the API instead now (because it’s looking at the metadata
stored in S3).
This commit is contained in:
Chris Hill-Scott
2018-04-30 12:10:20 +01:00
parent 98214884d3
commit 8c04f8f21a
2 changed files with 0 additions and 104 deletions

View File

@@ -641,17 +641,6 @@ def check_messages_preview(service_id, template_id, upload_id, filetype, row_ind
@login_required
@user_has_permissions('send_messages', restrict_admin_usage=True)
def start_job(service_id, upload_id):
try:
upload_data = session['file_uploads'][upload_id]
except KeyError:
current_app.logger.exception('upload_id not in session')
return redirect(url_for('main.choose_template', service_id=service_id), code=301)
if request.files or not upload_data.get('valid'):
# The csv was invalid, validate the csv again
return send_messages(service_id, upload_data.get('template_id'))
session['file_uploads'].pop(upload_id)
job_api_client.create_job(
upload_id,