Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MaticConradi committed Jun 11, 2022
1 parent e82a913 commit 6118e68
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/components/iexc.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def _request_stocks(cls, request, ticker):
try:
stock = Stock(ticker.get("symbol"), token=environ["IEXC_KEY"])
rawData = stock.get_quote().loc[ticker.get("symbol")]
if ticker.get("quote") is None and exchange is not None: return [{}, f"Price for `{ticker.get('name')}` is not available on {exchange.get('name')}."]
if ticker.get("quote") is None and exchange is not None: return [{}, f"Price for `{ticker.get('name')}` is not available on {exchange.name}."]
if rawData is None or (rawData["latestPrice"] is None and rawData["delayedPrice"] is None): return [{}, ""]
except:
return [{}, ""]
Expand All @@ -60,7 +60,7 @@ def _request_stocks(cls, request, ticker):
"change": "{:+.2f} %".format(priceChange),
"thumbnailUrl": coinThumbnail,
"messageColor": "amber" if priceChange == 0 else ("green" if priceChange > 0 else "red"),
"sourceText": f"Price on {exchange.get('name')}",
"sourceText": f"Price on {exchange.name}",
"platform": "IEXC",
"raw": {
"quotePrice": [price],
Expand Down

0 comments on commit 6118e68

Please sign in to comment.