mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2025-01-30 20:56:39 +00:00
fix: remove trash imports
This commit is contained in:
parent
27254dd014
commit
be9be5c975
|
@ -8,11 +8,6 @@ from typing import Optional
|
||||||
from selfprivacy_api import PLEASE_UPDATE_APP_TEXT
|
from selfprivacy_api import PLEASE_UPDATE_APP_TEXT
|
||||||
from selfprivacy_api.models.user import UserDataUser, UserDataUserOrigin
|
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.utils import is_username_forbidden
|
||||||
from selfprivacy_api.actions.ssh import get_ssh_keys
|
from selfprivacy_api.actions.ssh import get_ssh_keys
|
||||||
|
|
||||||
|
|
|
@ -10,10 +10,6 @@ from selfprivacy_api.graphql.common_types.user import (
|
||||||
get_users,
|
get_users,
|
||||||
)
|
)
|
||||||
from selfprivacy_api.graphql import IsAuthenticated
|
from selfprivacy_api.graphql import IsAuthenticated
|
||||||
from selfprivacy_api.repositories.users.exceptions_kanidm import (
|
|
||||||
KanidmReturnUnknownResponseType,
|
|
||||||
KanidmReturnEmptyResponse,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@strawberry.type
|
@strawberry.type
|
||||||
|
@ -21,10 +17,7 @@ class Users:
|
||||||
@strawberry.field(permission_classes=[IsAuthenticated])
|
@strawberry.field(permission_classes=[IsAuthenticated])
|
||||||
def get_user(self, username: str) -> typing.Optional[User]:
|
def get_user(self, username: str) -> typing.Optional[User]:
|
||||||
"""Get users"""
|
"""Get users"""
|
||||||
try:
|
|
||||||
return get_user_by_username(username)
|
return get_user_by_username(username)
|
||||||
except (KanidmReturnUnknownResponseType, KanidmReturnEmptyResponse):
|
|
||||||
pass # TODO what todo ??
|
|
||||||
|
|
||||||
all_users: typing.List[User] = strawberry.field(
|
all_users: typing.List[User] = strawberry.field(
|
||||||
permission_classes=[IsAuthenticated], resolver=get_users
|
permission_classes=[IsAuthenticated], resolver=get_users
|
||||||
|
|
Loading…
Reference in a new issue