aboutsummaryrefslogtreecommitdiff
path: root/app/views.py
diff options
context:
space:
mode:
authorNavan Chauhan <navanchauhan@gmail.com>2020-07-07 22:31:15 +0530
committerNavan Chauhan <navanchauhan@gmail.com>2020-07-07 22:31:15 +0530
commit9cfcd4e9e135e4e0c5d6818e86e6ddecf74188af (patch)
tree44249c8ea66de0873a4b76d499e7883da55a9eca /app/views.py
parent5323ee27404270d4bd8b36abd443db7268351cbe (diff)
fixed anti-pattern code
Diffstat (limited to 'app/views.py')
-rw-r--r--app/views.py23
1 files changed, 11 insertions, 12 deletions
diff --git a/app/views.py b/app/views.py
index 3769d75..690c7b0 100644
--- a/app/views.py
+++ b/app/views.py
@@ -62,18 +62,17 @@ def status():
records = mycursor.fetchall()
if records == []:
return render_template('job_status_error.html',job=jobID)
- else:
- r = records[0]
- protein_name = r[1]
- ligand_name = r[2]
- date = r[3]
- description = r[4]
- done = r[5]
- if done==1:
- 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)
+ r = records[0]
+ protein_name = r[1]
+ ligand_name = r[2]
+ date = r[3]
+ description = r[4]
+ done = r[5]
+ if done==1:
+ 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)
flash_errors(taskStatusForm)
return render_template('job_status_form.html',form=taskStatusForm)