feat: права и инвайты
This commit is contained in:
@@ -9,6 +9,10 @@ def UserNotFound(user_id: uuid.UUID | None = None) -> HTTPException:
|
||||
return HTTPException(status.HTTP_404_NOT_FOUND, f'User {user_id} not found')
|
||||
|
||||
|
||||
def UserByUsernameNotFound(username: str) -> HTTPException:
|
||||
return HTTPException(status.HTTP_404_NOT_FOUND, f'User @{username} not found')
|
||||
|
||||
|
||||
def LoginTokenNotFound() -> HTTPException:
|
||||
return HTTPException(status.HTTP_404_NOT_FOUND, 'Login token not found')
|
||||
|
||||
@@ -84,3 +88,17 @@ def WorkspaceAccessDenied(workspace_id: uuid.UUID | None = None) -> HTTPExceptio
|
||||
if workspace_id is None:
|
||||
return HTTPException(status.HTTP_403_FORBIDDEN, 'Workspace access denied')
|
||||
return HTTPException(status.HTTP_403_FORBIDDEN, f'Workspace {workspace_id} access denied')
|
||||
|
||||
|
||||
def WorkspaceInviteNotFound(invite_id: uuid.UUID | None = None) -> HTTPException:
|
||||
if invite_id is None:
|
||||
return HTTPException(status.HTTP_404_NOT_FOUND, 'Workspace invite not found')
|
||||
return HTTPException(status.HTTP_404_NOT_FOUND, f'Workspace invite {invite_id} not found')
|
||||
|
||||
|
||||
def WorkspaceInviteAlreadyExists() -> HTTPException:
|
||||
return HTTPException(status.HTTP_409_CONFLICT, 'Workspace invite already exists for this user')
|
||||
|
||||
|
||||
def WorkspaceMemberAlreadyExists() -> HTTPException:
|
||||
return HTTPException(status.HTTP_409_CONFLICT, 'User is already a workspace member')
|
||||
|
||||
Reference in New Issue
Block a user