From be9be5c97585b8ee9d56cb97edb3b911746aa10d Mon Sep 17 00:00:00 2001 From: dettlaff Date: Wed, 11 Dec 2024 07:15:40 +0400 Subject: [PATCH] fix: remove trash imports --- selfprivacy_api/actions/users.py | 5 ----- selfprivacy_api/graphql/queries/users.py | 9 +-------- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/selfprivacy_api/actions/users.py b/selfprivacy_api/actions/users.py index af57ef6..8c60d98 100644 --- a/selfprivacy_api/actions/users.py +++ b/selfprivacy_api/actions/users.py @@ -8,11 +8,6 @@ from typing import Optional from selfprivacy_api import PLEASE_UPDATE_APP_TEXT from selfprivacy_api.models.user import UserDataUser, UserDataUserOrigin -from selfprivacy_api.repositories.users.exceptions_kanidm import ( - KanidmQueryError, - KanidmReturnEmptyResponse, - KanidmReturnUnknownResponseType, -) from selfprivacy_api.utils import is_username_forbidden from selfprivacy_api.actions.ssh import get_ssh_keys diff --git a/selfprivacy_api/graphql/queries/users.py b/selfprivacy_api/graphql/queries/users.py index e5bd301..992ce01 100644 --- a/selfprivacy_api/graphql/queries/users.py +++ b/selfprivacy_api/graphql/queries/users.py @@ -10,10 +10,6 @@ from selfprivacy_api.graphql.common_types.user import ( get_users, ) from selfprivacy_api.graphql import IsAuthenticated -from selfprivacy_api.repositories.users.exceptions_kanidm import ( - KanidmReturnUnknownResponseType, - KanidmReturnEmptyResponse, -) @strawberry.type @@ -21,10 +17,7 @@ class Users: @strawberry.field(permission_classes=[IsAuthenticated]) def get_user(self, username: str) -> typing.Optional[User]: """Get users""" - try: - return get_user_by_username(username) - except (KanidmReturnUnknownResponseType, KanidmReturnEmptyResponse): - pass # TODO what todo ?? + return get_user_by_username(username) all_users: typing.List[User] = strawberry.field( permission_classes=[IsAuthenticated], resolver=get_users