Commit 8095ea7e by Luciano Barletta

fixed sqlite bug

1 parent e1ec510d
from services import serviceFactory from services import serviceFactory
from database import DBconnection from database import DBconnection
from enums import Services, States, Datatypes, Table from enums import Services, States, Datatypes, Table
import os, json import os, json, ipdb
class Process: class Process:
...@@ -45,10 +45,12 @@ class Process: ...@@ -45,10 +45,12 @@ class Process:
Table.dest : query[Table.dest], Table.dest : query[Table.dest],
Table.serv : query[Table.serv], Table.serv : query[Table.serv],
Table.type : query[Table.type], Table.type : query[Table.type],
Table.info : query[Table.info],
Table.conf : query[Table.conf],
Table.state : States.queued Table.state : States.queued
} }
if query[Table.info]:
entities[Table.info] = query[Table.info]
if query[Table.conf]:
entities[Table.conf] = query[Table.conf]
error = self.conn.update("msg",(Table.id,query[Table.id]),entities) error = self.conn.update("msg",(Table.id,query[Table.id]),entities)
if error: if error:
return error return error
...@@ -80,7 +82,7 @@ class Process: ...@@ -80,7 +82,7 @@ class Process:
# todo enviado # todo enviado
if len(d) == 0: if len(d) == 0:
# no se espera confirmacion # no se espera confirmacion
if query[Table.conf] == 'None' or query[Table.conf] == 'None': if query[Table.conf] == None:
self.conn.query("DELETE FROM msg WHERE id = ?",(query[Table.id],)) self.conn.query("DELETE FROM msg WHERE id = ?",(query[Table.id],))
del query[Table.id] del query[Table.id]
self.conn.insert("history",query) self.conn.insert("history",query)
......
...@@ -63,7 +63,6 @@ class Wpp1(ServiceBase): ...@@ -63,7 +63,6 @@ class Wpp1(ServiceBase):
return type in Wpp1.Allowed return type in Wpp1.Allowed
def validateinfo(self,info): def validateinfo(self,info):
info = None if info == 'None' else info
if info == None: if info == None:
return True return True
i = json.loads(info) i = json.loads(info)
...@@ -134,7 +133,6 @@ class Mail(ServiceBase): ...@@ -134,7 +133,6 @@ class Mail(ServiceBase):
return type in Mail.Allowed return type in Mail.Allowed
def validateinfo(self,info): def validateinfo(self,info):
info = None if info == 'None' else info
if info == None: if info == None:
return False return False
i = json.loads(info) i = json.loads(info)
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!