Skip to content

Commit

Permalink
[Community] improve startup info parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume De Saint Martin authored and GuillaumeDSM committed Feb 24, 2023
1 parent 1b5ee3e commit 559158b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions octobot/community/startup_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ def __init__(self, forced_profile, subscribed_products):
self.forced_profile = forced_profile
self.subscribed_products = subscribed_products

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

def get_subscribed_products_urls(self) -> list:
return [
Expand All @@ -36,8 +36,8 @@ def get_subscribed_products_urls(self) -> list:
@staticmethod
def from_dict(data):
return StartupInfo(
data[StartupInfo.FORCED_PROFILE_URL],
data[StartupInfo.SUBSCRIBED_PRODUCTS]
data.get(StartupInfo.FORCED_PROFILE_URL, {}) or {},
data.get(StartupInfo.SUBSCRIBED_PRODUCTS, []) or []
)

def __str__(self):
Expand Down

0 comments on commit 559158b

Please sign in to comment.