Commit 8095ea7e by Luciano Barletta

fixed sqlite bug

1 parent e1ec510d
from services import serviceFactory
from database import DBconnection
from enums import Services, States, Datatypes, Table
import os, json
import os, json, ipdb
class Process:
......@@ -45,10 +45,12 @@ class Process:
Table.dest : query[Table.dest],
Table.serv : query[Table.serv],
Table.type : query[Table.type],
Table.info : query[Table.info],
Table.conf : query[Table.conf],
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)
if error:
return error
......@@ -80,7 +82,7 @@ class Process:
# todo enviado
if len(d) == 0:
# 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],))
del query[Table.id]
self.conn.insert("history",query)
......
......@@ -63,7 +63,6 @@ class Wpp1(ServiceBase):
return type in Wpp1.Allowed
def validateinfo(self,info):
info = None if info == 'None' else info
if info == None:
return True
i = json.loads(info)
......@@ -134,7 +133,6 @@ class Mail(ServiceBase):
return type in Mail.Allowed
def validateinfo(self,info):
info = None if info == 'None' else info
if info == None:
return False
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!