diff options
author | Navan Chauhan <navanchauhan@gmail.com> | 2020-09-24 16:31:42 +0530 |
---|---|---|
committer | Navan Chauhan <navanchauhan@gmail.com> | 2020-09-24 16:31:42 +0530 |
commit | 8f534261a934542fef612362ab851b87c59887dd (patch) | |
tree | 86854a40091bc0848feaf48bd7241790bedbb3f0 /app/views.py | |
parent | 16cd0e78e9ea6dcb960816db138640d047b89bb7 (diff) |
added check for file
Diffstat (limited to 'app/views.py')
-rw-r--r-- | app/views.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/app/views.py b/app/views.py index fd44f6d..5b105ed 100644 --- a/app/views.py +++ b/app/views.py @@ -156,7 +156,17 @@ def status(): AndroidModel = "/static/uploads/3DModels/" + str(jobID) + ".gltf" iOSModel = "/static/uploads/3DModels/" + str(jobID) + ".usdz" - return render_template('job_status.html',ID=jobID,pn=protein_name,ln=ligand_name,subDate=date,desc=description,status=done,PDFReport=PDFReport,AndroidModel=AndroidModel,iOSModel=iOSModel) + uploadsFolder = os.path.join(base,"app/static/uploads/") + if os.path.exists(os.path.join(uploadsFolder,"reports",str(jobID)+".pdf")): + reportDone = 'exists' + else: + reportDone = False + if os.path.exists(os.path.join(uploadsFolder,"3DModels",str(jobID)+".gltf")): + ModelDone = 'exists' + else: + ModelDone = False + + return render_template('job_status.html',ID=jobID,pn=protein_name,ln=ligand_name,subDate=date,desc=description,status=done,model=ModelDone,report=reportDone,PDFReport=PDFReport,AndroidModel=AndroidModel,iOSModel=iOSModel) flash_errors(taskStatusForm) return render_template('job_status_form.html',form=taskStatusForm) |