From 2e64b4d81a91ba229c2062354bda8e191c8ec92a Mon Sep 17 00:00:00 2001 From: Ville Rantanen Date: Mon, 13 Jul 2015 13:57:08 +0300 Subject: [PATCH] dont update message, if not provided --- nandod | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nandod b/nandod index 4eee971..b9c9312 100755 --- a/nandod +++ b/nandod @@ -85,7 +85,11 @@ class DataBase: except: return self.db=self.conn.cursor() - self.db.execute("INSERT OR REPLACE INTO alive(id,ip,date,desc) \ + if desc is "": + self.db.execute("INSERT OR REPLACE INTO alive(id,ip,date) \ + VALUES(?,?,?)",(host,ip,int(time.time()))) + else: + self.db.execute("INSERT OR REPLACE INTO alive(id,ip,date,desc) \ VALUES(?,?,?,?)",(host,ip,int(time.time()),desc)) self.conn_end()