Skip to content

Commit 9daac5e

Browse files
committed
Fixed work with None value for JournalTypes
1 parent 73fa1cb commit 9daac5e

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

bugout/app.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,10 +351,12 @@ def create_journal(
351351
self,
352352
token: Union[str, uuid.UUID],
353353
name: str,
354-
journal_type: Union[str, data.JournalTypes],
354+
journal_type: Optional[Union[str, data.JournalTypes]] = None,
355355
timeout: float = REQUESTS_TIMEOUT,
356356
) -> data.BugoutJournal:
357357
self.journal.timeout = timeout
358+
if journal_type is None:
359+
journal_type = data.JournalTypes.DEFAULT
358360
return self.journal.create_journal(
359361
token=token, name=name, journal_type=data.JournalTypes(journal_type)
360362
)

bugout/journal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def create_journal(
112112
self,
113113
token: Union[str, uuid.UUID],
114114
name: str,
115-
journal_type: JournalTypes = JournalTypes.DEFAULT,
115+
journal_type: JournalTypes,
116116
) -> BugoutJournal:
117117
journal_path = "journals/"
118118
json = {"name": name, "journal_type": journal_type.value}

0 commit comments

Comments
 (0)