notificationbox
This commit is contained in:
@@ -2,11 +2,14 @@
|
||||
from .DbManager import DbManager
|
||||
from ..PyqcrmFlags import PyqcrmFlags
|
||||
import mariadb
|
||||
from PySide6.QtCore import QObject, Signal
|
||||
|
||||
class UserDAO:
|
||||
class UserDAO(QObject):
|
||||
noDbConnection = Signal(str)
|
||||
__cursor = None
|
||||
def __init__(self):
|
||||
#print(f"*** File: {__file__}, init()")
|
||||
super().__init__()
|
||||
self.__con = DbManager().getConnection()
|
||||
if self.__con:
|
||||
self.__cur = self.__con.cursor()
|
||||
@@ -22,6 +25,7 @@ class UserDAO:
|
||||
print(f"Error: {e}")
|
||||
print(e.errno)
|
||||
user_created = False
|
||||
self.noDbConnection.emit(str(e))
|
||||
finally:
|
||||
return user_created
|
||||
|
||||
@@ -34,6 +38,7 @@ class UserDAO:
|
||||
return None
|
||||
except mariadb.Error as e:
|
||||
print(str(e))
|
||||
self.noDbConnection.emit(str(e))
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user