A-0.2 - Datenbankverbindung #35

Merged
edraft merged 13 commits from 0.2 into Alpha 2021-12-01 17:57:52 +01:00
2 changed files with 2 additions and 2 deletions
Showing only changes of commit 1a5767edf0 - Show all commits

View File

@ -46,7 +46,7 @@ class ServerRepositoryService(ServerRepositoryABC):
def find_server_by_discord_id(self, discord_id: int) -> Optional[Server]: def find_server_by_discord_id(self, discord_id: int) -> Optional[Server]:
self._logger.trace(__name__, f'Send SQL command: {Server.get_select_by_discord_id_string(discord_id)}') self._logger.trace(__name__, f'Send SQL command: {Server.get_select_by_discord_id_string(discord_id)}')
result = self._context.select(Server.get_select_by_discord_id_string(discord_id)) result = self._context.select(Server.get_select_by_discord_id_string(discord_id))
if len(result) == 0: if len(result) == 0 or result is None:
return None return None
return Server( return Server(

View File

@ -55,7 +55,7 @@ class UserRepositoryService(UserRepositoryABC):
def find_user_by_discord_id(self, discord_id: int) -> Optional[User]: def find_user_by_discord_id(self, discord_id: int) -> Optional[User]:
self._logger.trace(__name__, f'Send SQL command: {User.get_select_by_discord_id_string(discord_id)}') self._logger.trace(__name__, f'Send SQL command: {User.get_select_by_discord_id_string(discord_id)}')
result = self._context.select(User.get_select_by_discord_id_string(discord_id)) result = self._context.select(User.get_select_by_discord_id_string(discord_id))
if len(result) == 0: if len(result) == 0 or result is None:
return None return None
return User( return User(