Commit 7aecc10c authored by pengxiong's avatar pengxiong

fix

parent d42adbb5
......@@ -147,6 +147,7 @@ class HoldDiagnoseReport(Base, BaseModel):
res = tamp_user_session.execute(sql)
sql2 = "select customer_name from tamp_diagnose_app.customer_view where id = '{}'".format(self.customer_id)
res2 = tamp_diagnose_app_session.execute(sql2)
if data:
if res.fetchone():
data['author_name'] = res.fetchone()[0]
else:
......@@ -187,6 +188,7 @@ class HoldReport(Base, BaseModel):
res = tamp_user_session.execute(sql)
sql2 = "select customer_name from tamp_diagnose_app.customer_view where id = '{}'".format(self.customer_id)
res2 = tamp_diagnose_app_session.execute(sql2)
if data:
if res.fetchone():
data['author_name'] = res.fetchone()[0]
else:
......@@ -227,6 +229,7 @@ class PeriodicReport(Base, BaseModel):
res = tamp_user_session.execute(sql)
sql2 = "select customer_name from tamp_diagnose_app.customer_view where id = '{}'".format(self.customer_id)
res2 = tamp_diagnose_app_session.execute(sql2)
if data:
if res.fetchone():
data['author_name'] = res.fetchone()[0]
else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment