Skip to content

Commit 6e9955c

Browse files
Bug fix from get_files method.
1 parent 242cfe5 commit 6e9955c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

centraldogma/content_service.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,11 @@ def get_files(
5656
path += "/" + path_pattern
5757

5858
handler = {
59-
HTTPStatus.OK: lambda resp: [
60-
Content.from_dict(content) for content in resp.json()
61-
],
59+
HTTPStatus.OK: lambda resp: (lambda data: [
60+
Content.from_dict(content) for content in data
61+
] if isinstance(data, list) else [
62+
Content.from_dict(data)
63+
])(resp.json()),
6264
HTTPStatus.NO_CONTENT: lambda resp: [],
6365
}
6466
return self.client.request("get", path, params=params, handler=handler)

0 commit comments

Comments
 (0)