From 4815cbde39d6b18d482c33fa22816ecc8e755d37 Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Sun, 30 Aug 2020 16:45:47 +0530 Subject: stores a local copy in the reports folder --- app/views.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'app/views.py') diff --git a/app/views.py b/app/views.py index b1aa800..2266f40 100644 --- a/app/views.py +++ b/app/views.py @@ -85,7 +85,7 @@ def status(): import mysql.connector as con mycon = con.connect(host=app.config['DB_HOST'],user=app.config['DB_USER'],password=app.config['DB_PASSWORD'],port=app.config['DB_PORT'],database=app.config['DB_NAME']) mycursor = mycon.cursor() - sqlQuery = 'select id, protein_name, ligand_name, date, description, done from curieweb where id="%s"' % (jobID) + sqlQuery = 'select id, protein_name, ligand_name, date, description, done, pdb from curieweb where id="%s"' % (jobID) mycursor.execute(sqlQuery) records = mycursor.fetchall() if records == []: @@ -100,7 +100,12 @@ def status(): done="Completed" elif done==0: done="Queued" - return render_template('job_status.html',ID=jobID,pn=protein_name,ln=ligand_name,subDate=date,desc=description,status=done) + if protein_name == None: + protein_name = r[6] + + PDFReport = "/static/uploads/reports/" + str(jobID) + ".pdf" + + return render_template('job_status.html',ID=jobID,pn=protein_name,ln=ligand_name,subDate=date,desc=description,status=done,PDFReport=PDFReport) flash_errors(taskStatusForm) return render_template('job_status_form.html',form=taskStatusForm) -- cgit v1.2.3