Merge pull request #26 from zomglings/fix-subscription-mypy-error

Fixed small mypy issue when working with application_id
new-indices
Yhtyyar Sahatov 2021-07-28 20:31:02 +03:00 zatwierdzone przez GitHub
commit d1bd4dc728
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
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")