From a24fefd3e22352195ecb18aa2119680c2f02c4ea Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Fri, 26 Jan 2024 14:03:47 +0100 Subject: [PATCH] Fixed test mail & delete auth user --- bot/src/bot/translation/de.json | 2 +- bot/src/bot_data/model/auth_user.py | 9 +++++++++ bot/src/bot_data/service/auth_user_repository_service.py | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/bot/src/bot/translation/de.json b/bot/src/bot/translation/de.json index 45f64e14..60b069a8 100644 --- a/bot/src/bot/translation/de.json +++ b/bot/src/bot/translation/de.json @@ -2,7 +2,7 @@ "api": { "api": { "test_mail": { - "message": "Dies ist eine Test-Mail vom Krümelmonster Web Interface\nGesendet von {}-{}", + "message": "Dies ist eine Test-Mail vom Kruemelmonster Web Interface\r\nGesendet von {}-{}", "subject": "Krümelmonster Web Interface Test-Mail" } }, diff --git a/bot/src/bot_data/model/auth_user.py b/bot/src/bot_data/model/auth_user.py index 47bdf41a..13c77bd6 100644 --- a/bot/src/bot_data/model/auth_user.py +++ b/bot/src/bot_data/model/auth_user.py @@ -258,6 +258,15 @@ class AuthUser(TableABC): """ ) + @property + def delete_relations_string(self) -> str: + return str( + f""" + DELETE FROM `AuthUserUsersRelations` + WHERE `AuthUserId` = {self._auth_user_id}; + """ + ) + @property def delete_string(self) -> str: return str( diff --git a/bot/src/bot_data/service/auth_user_repository_service.py b/bot/src/bot_data/service/auth_user_repository_service.py index 70ebb786..1f657d3a 100644 --- a/bot/src/bot_data/service/auth_user_repository_service.py +++ b/bot/src/bot_data/service/auth_user_repository_service.py @@ -164,6 +164,7 @@ class AuthUserRepositoryService(AuthUserRepositoryABC): def delete_auth_user(self, user: AuthUser): self._logger.trace(__name__, f"Send SQL command: {user.delete_string}") + self._context.cursor.execute(user.delete_relations_string) self._context.cursor.execute(user.delete_string) def add_auth_user_user_rel(self, rel: AuthUserUsersRelation):