Skip to content

Commit c2582e9

Browse files
committed
addressing @wasade comments
1 parent 6b3c252 commit c2582e9

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

qiita_db/processing_job.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -866,8 +866,8 @@ def processing_job_worflow(self):
866866
qdb.sql_connection.TRN.add(sql, [self.id])
867867
r = qdb.sql_connection.TRN.execute_fetchindex()
868868

869-
return (None if not r
870-
else qdb.processing_job.ProcessingWorkflow(r[0][0]))
869+
return (qdb.processing_job.ProcessingWorkflow(r[0][0]) if r
870+
else None)
871871

872872

873873
class ProcessingWorkflow(qdb.base.QiitaObject):

qiita_pet/handlers/api_proxy/user.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ def user_jobs_get_req(user):
3535
cmd = j.command
3636
if cmd not in cmds:
3737
cmds[cmd] = cmd
38-
ccmd = cmds[cmd]
38+
name = cmds[cmd].name
3939
hb = j.heartbeat
4040
hb = "" if hb is None else hb.strftime("%Y-%m-%d %H:%M:%S")
4141
pjw = j.processing_job_worflow
4242
wid = '' if pjw is None else pjw.id
4343
response.append({
4444
'id': j.id,
45-
'name': ccmd.name,
45+
'name': name,
4646
'params': j.parameters.values,
4747
'status': j.status,
4848
'heartbeat': hb,

qiita_pet/handlers/user_handlers.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from tornado.web import authenticated, HTTPError
2+
from tornado.gen import coroutine
23
from future.utils import viewitems
34
from wtforms import Form, StringField, validators
45

@@ -190,6 +191,7 @@ def post(self):
190191

191192
class UserJobs(BaseHandler):
192193
@authenticated
194+
@coroutine
193195
def get(self):
194196
response = user_jobs_get_req(self.current_user)
195197
self.write(response)

0 commit comments

Comments
 (0)