diff --git a/repository/emails.py b/repository/emails.py index 82bc9f8..da8c893 100644 --- a/repository/emails.py +++ b/repository/emails.py @@ -45,9 +45,7 @@ def get_all(): smtp_server_port = emailServer.getPort() user = db.searchUser(config['Telegram']['ADMIN_ID']) from_email = user.getAccounts()[0].getUsername() - print(from_email) from_pwd = user.getAccounts()[0].getPassword() - print(from_pwd) admin_id = user.getId() u_content = UserContent() diff --git a/repository/repository.py b/repository/repository.py index 81806b0..0870e25 100644 --- a/repository/repository.py +++ b/repository/repository.py @@ -2,7 +2,7 @@ from tinydb import TinyDB, Query from repository.EmailServer import EmailServer from repository.User import User -from repository.Account import Account,parseAccountsToJson,parseJsonToAccounts +from repository.Account import parseAccountsToJson,parseJsonToAccounts class DBC: def __init__(self, path=None): @@ -82,4 +82,8 @@ def updateAccountOfUser(self, user, account): def removeAccountOfUser(self, user, account): user = self.searchUser(user.getId()) user.removeAccount(account) - self.updateUser(user) \ No newline at end of file + self.updateUser(user) + + def getEmailServerOfAccount(self, account, protocol): + emailServer = self.searchEmailServer(account.getName(), protocol) + return emailServer \ No newline at end of file