diff options
author | Navan Chauhan <navanchauhan@gmail.com> | 2020-08-30 16:45:47 +0530 |
---|---|---|
committer | Navan Chauhan <navanchauhan@gmail.com> | 2020-08-30 16:45:47 +0530 |
commit | 4815cbde39d6b18d482c33fa22816ecc8e755d37 (patch) | |
tree | 777bb20f423d602cfbcaa45435db5754305f3014 /app/views.py | |
parent | e64830992db27939840bc68364de3f47441c154f (diff) |
stores a local copy in the reports folder
Diffstat (limited to 'app/views.py')
-rw-r--r-- | app/views.py | 9 |
1 files changed, 7 insertions, 2 deletions
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) |