diff --git a/kdb-bot/src/bot_api/service/auth_service.py b/kdb-bot/src/bot_api/service/auth_service.py index 0211687b..94410b52 100644 --- a/kdb-bot/src/bot_api/service/auth_service.py +++ b/kdb-bot/src/bot_api/service/auth_service.py @@ -494,11 +494,10 @@ class AuthService(AuthServiceABC): added_user = True db_user = self._auth_users.get_auth_user_by_email(user_dto.email) + user_ids = db_user.users.select(lambda x: x.id) - auth_user_relation_ids = self._auth_users.get_auth_user_relation_ids(db_user) - - for user in db_user.users: - if user.id in auth_user_relation_ids: + for user in self._users.get_users_by_discord_id(dc_id): + if user.id in user_ids: continue self._auth_users.add_auth_user_user_rel(AuthUserUsersRelation(db_user, user))