Fix adding a contact person to an object and db autocommit
This commit is contained in:
@@ -22,8 +22,13 @@ class ContactDAO(QObject):
|
||||
if self.__cur:
|
||||
self.__cur.callproc("addContactPerson", (enc_key, json.dumps(contact),))
|
||||
self.__con.commit()
|
||||
self.__cur.callproc("getLastInsertId")
|
||||
contact_id = self.__cur.fetchone()
|
||||
self.__cur.callproc("logger",(contact_id[0], "INSERT", "addContactPerson: New Contact added",))
|
||||
self.__con.commit()
|
||||
return contact_id[0]
|
||||
else:
|
||||
return None
|
||||
except mariadb.Error as e:
|
||||
print("MDB: " + str(e))
|
||||
except Exception as e:
|
||||
@@ -36,7 +41,7 @@ class ContactDAO(QObject):
|
||||
self.__con.commit()
|
||||
self.__cur.callproc("logObjectContact")
|
||||
self.__con.commit()
|
||||
self.newObjectContactAdded.emit(True)
|
||||
# self.newObjectContactAdded.emit(True)
|
||||
except mariadb.Error as e:
|
||||
print("MDB (addObjectContact): " + str(e))
|
||||
self.newObjectContactAdded.emit(False)
|
||||
|
||||
Reference in New Issue
Block a user