Spaces:
Build error
Build error
Update app.py
Browse files
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
|
| 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
|
| 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
|