From fca352c3dd2d20f3eaac014bb124c2ce33c905ba Mon Sep 17 00:00:00 2001 From: Patrick Jentsch Date: Thu, 24 Oct 2019 13:28:32 +0200 Subject: [PATCH] Add dir to job creation. --- app/services/views.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/services/views.py b/app/services/views.py index 528545a2..49d008af 100644 --- a/app/services/views.py +++ b/app/services/views.py @@ -56,7 +56,11 @@ def service(service_handle): ''' TODO: Use secure filename ''' filename = secure_filename(file.filename) file.save(os.path.join(dir, filename)) - job_input = JobInput(filename=filename, job=job) + job_input = JobInput( + dir=os.path.join(str(job.user_id), 'jobs', str(job.id)), + filename=filename, + job=job + ) db.session.add(job_input) job.status = 'submitted' db.session.commit()