Skip to content

Commit 33ecf56

Browse files
committed
Fixed bug in list_scopes
Results is a JSON list of objects that cast into BugoutScope. The library was trying to unpack this list as a dictionary into BugoutScopes. Fixed now with explicit unpacking of a list of `BugoutScope` objects constructed from the results.
1 parent 5303ae5 commit 33ecf56

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

bugout/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
__email__ = "engineering@bugout.dev"
99
__license__ = "MIT"
10-
__version__ = "0.0.7"
10+
__version__ = "0.0.8"
1111

1212
__all__ = (
1313
"__author__",

bugout/journal.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from .data import (
66
BugoutJournal,
77
BugoutJournals,
8+
BugoutScope,
89
BugoutScopes,
910
BugoutJournalScopeSpecs,
1011
BugoutJournalEntry,
@@ -45,7 +46,8 @@ def list_scopes(self, token: Union[str, uuid.UUID], api: str) -> BugoutScopes:
4546
result = self._call(
4647
method=Method.get, path=scopes_path, headers=headers, json=json
4748
)
48-
return BugoutScopes(**result)
49+
scopes = [BugoutScope(**item) for item in result]
50+
return BugoutScopes(scopes=scopes)
4951

5052
def get_journal_scopes(
5153
self, token: Union[str, uuid.UUID], journal_id: Union[str, uuid.UUID]

0 commit comments

Comments
 (0)