Compare commits

...

4 Commits

Author SHA1 Message Date
penner42
6f2967a552 Merge pull request #210 from penner42/Issue-135
Issue 135
2014-01-31 11:43:51 -08:00
Alan Penner
42d6c47edc check shareid before shareid[0] 2014-01-31 11:38:17 -08:00
Alan Penner
223b172cc6 Merge branch 'ahmedmaster' 2014-01-31 11:35:39 -08:00
Alan Penner
8c598d1cf2 fix indent 2014-01-30 16:57:30 -08:00
2 changed files with 9 additions and 10 deletions

View File

@ -125,7 +125,7 @@ class DB_Mysql():
shareid = self.dbc.fetchone() shareid = self.dbc.fetchone()
if shareid[0] > 0: if shareid and shareid[0] > 0:
# Note: difficulty = -1 here # Note: difficulty = -1 here
self.execute( self.execute(
""" """

View File

@ -83,7 +83,7 @@ class DB_Mysql_Vardiff(DB_Mysql.DB_Mysql):
shareid = self.dbc.fetchone() shareid = self.dbc.fetchone()
if shareid[0] > 0: if shareid and shareid[0] > 0:
# Note: difficulty = -1 here # Note: difficulty = -1 here
self.execute( self.execute(
""" """
@ -113,16 +113,15 @@ class DB_Mysql_Vardiff(DB_Mysql.DB_Mysql):
%(lres)s, %(result)s, %(reason)s, %(solution)s) %(lres)s, %(result)s, %(reason)s, %(solution)s)
""", """,
{ {
"time": v[4], "time": data[4],
"host": v[6], "host": data[6],
"uname": v[0], "uname": data[0],
"lres": v[5], "lres": data[5],
"result": v[5], "result": data[5],
"reason": v[9], "reason": data[9],
"solution": v[2] "solution": data[2]
} }
) )
self.dbh.commit() self.dbh.commit()