Fixed small mypy issue when working with application_id

pull/26/head
Neeraj Kashyap 2021-07-28 10:28:17 -07:00
rodzic 876c23aac1
commit f0113d8564
2 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -99,7 +99,6 @@ async def add_subscription_handler(
resource_data.update(subscription_data)
try:
resource: BugoutResource = bc.create_resource(
token=token,
application_id=MOONSTREAM_APPLICATION_ID,

Wyświetl plik

@ -5,8 +5,9 @@ from bugout.app import Bugout
# Bugout
bugout_client = Bugout()
MOONSTREAM_APPLICATION_ID = os.environ.get("MOONSTREAM_APPLICATION_ID")
if MOONSTREAM_APPLICATION_ID is None:
# Default value is "" instead of None so that mypy understands that MOONSTREAM_APPLICATION_ID is a string
MOONSTREAM_APPLICATION_ID = os.environ.get("MOONSTREAM_APPLICATION_ID", "")
if MOONSTREAM_APPLICATION_ID == "":
raise ValueError("MOONSTREAM_APPLICATION_ID environment variable must be set")
MOONSTREAM_DATA_JOURNAL_ID = os.environ.get("MOONSTREAM_DATA_JOURNAL_ID")