Skip to content

Commit b02e59f

Browse files
committed
fix: deletion response output
Exceptions were raised in case of dict responses
1 parent f801c56 commit b02e59f

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

scim2_cli/delete.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
import httpx
33
from click import ClickException
44
from scim2_client import SCIMClientError
5+
from scim2_models import Message
6+
from scim2_models import Resource
57
from sphinx_click.rst_to_ansi_formatter import make_rst_to_ansi_formatter
68

79
from .utils import DOC_URL
@@ -47,5 +49,10 @@ def delete_cli(ctx, resource_type, id, headers, indent):
4749
raise ClickException(exc) from exc
4850

4951
if response:
50-
payload = formatted_payload(response.model_dump(), indent)
52+
payload = (
53+
response.model_dump()
54+
if isinstance(response, (Resource, Message))
55+
else response
56+
)
57+
payload = formatted_payload(payload, indent)
5158
click.echo(payload)

0 commit comments

Comments
 (0)