Skip to content

Commit 559158b

Browse files
Guillaume De Saint MartinGuillaumeDSM
Guillaume De Saint Martin
authored andcommitted
[Community] improve startup info parsing
1 parent 1b5ee3e commit 559158b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

octobot/community/startup_info.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ def __init__(self, forced_profile, subscribed_products):
2424
self.forced_profile = forced_profile
2525
self.subscribed_products = subscribed_products
2626

27-
def get_forced_profile_url(self) -> list:
28-
return self.forced_profile[self.URL]
27+
def get_forced_profile_url(self) -> str:
28+
return self.forced_profile.get(self.URL, None)
2929

3030
def get_subscribed_products_urls(self) -> list:
3131
return [
@@ -36,8 +36,8 @@ def get_subscribed_products_urls(self) -> list:
3636
@staticmethod
3737
def from_dict(data):
3838
return StartupInfo(
39-
data[StartupInfo.FORCED_PROFILE_URL],
40-
data[StartupInfo.SUBSCRIBED_PRODUCTS]
39+
data.get(StartupInfo.FORCED_PROFILE_URL, {}) or {},
40+
data.get(StartupInfo.SUBSCRIBED_PRODUCTS, []) or []
4141
)
4242

4343
def __str__(self):

0 commit comments

Comments
 (0)