Aluode commited on
Commit
ade5e28
·
verified ·
1 Parent(s): 7678b73

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -329,7 +329,7 @@ def calculate_total_value(username, conn):
329
  def buy_stock(username, ticker, amount, conn, currency):
330
  current_price = get_stock_data(ticker, period='1d')
331
 
332
- if current_price is None or current_price empty:
333
  return "Invalid ticker symbol."
334
 
335
  total_cost = current_price['Close'].iloc[-1] * amount
@@ -365,7 +365,7 @@ def buy_stock(username, ticker, amount, conn, currency):
365
  def sell_stock(username, ticker, amount, conn, currency):
366
  current_price = get_stock_data(ticker, period='1d')
367
 
368
- if current_price is None or current_price empty:
369
  return "Invalid ticker symbol."
370
 
371
  total_value = current_price['Close'].iloc[-1] * amount
 
329
  def buy_stock(username, ticker, amount, conn, currency):
330
  current_price = get_stock_data(ticker, period='1d')
331
 
332
+ if current_price is None or current_price.empty:
333
  return "Invalid ticker symbol."
334
 
335
  total_cost = current_price['Close'].iloc[-1] * amount
 
365
  def sell_stock(username, ticker, amount, conn, currency):
366
  current_price = get_stock_data(ticker, period='1d')
367
 
368
+ if current_price is None or current_price.empty:
369
  return "Invalid ticker symbol."
370
 
371
  total_value = current_price['Close'].iloc[-1] * amount