fix: remove trash imports

This commit is contained in:
dettlaff 2024-12-11 07:15:40 +04:00
parent 27254dd014
commit be9be5c975
2 changed files with 1 additions and 13 deletions

View file

@ -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

View file

@ -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