added check for file

This commit is contained in:
Navan Chauhan 2020-09-24 16:31:42 +05:30
parent 16cd0e78e9
commit 8f534261a9
1 changed files with 11 additions and 1 deletions

View File

@ -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)