I have Finance barely ready but like most codes, it has a buggy near the finish line. I have a problem with lookup. Always return None. I check it.
and Terminal shows this error: TypeError: quote_from_bytes() expected bytes
Here's my python code where the bug is:
if request.method == "POST":
"""Sell shares of stock"""
symbol = request.form.get("symbol")
shares_sell = request.form.get("shares_sell")
symbol_sell = lookup(symbol)
and here's my html code: Where I think the problem is.
<form action="/sell" method="post">
<div class="form-group">
<select class="form-control" style="text-transform: uppercase">
<option disabled="" selected="" name="symbol">Symbol</option>
{% for row in portfolio %}
<option style="text-transform: uppercase; text-align: center" name="symbol">{{ row['symbol'] }}</option>
{% endfor %}
</select>
<input autocomplete="off" class="form-control" min="0" name="shares_sell" placeholder="Shares" type="number">
</div>
<button class="btn btn-primary" type="submit">Sell</button>
</form>
I think that the problem is that I can't take the information about "symbol" at the HTML and take it as "symbol" to application.py. would it be because of the select button instead of the input?
thank you for the time! Regards, Santiago Correa