Pset7 works perfectly: db writing , back-end calculations, front-end rendering - you name it. But check50, via cs50.me, complains:
Wheres this log ? There's no guidance as to which line, of which function, in which file, this is referring to. So Im hoping that the log being referred to is a real log which would give me those details, and not cs50.me, because that would be referring to itself - which is silly?
Where can I find the log being referred to? Or is cs50.me itself the log ? Or have I missed something?
The Buy Function @app.route("/buy", methods=["GET", "POST"]) @login_required def buy(): if request.method == "GET": return render_template("buy.html") if request.method == "POST": #pdb.set_trace() symbol = request.form.get('symbol').upper() stub = lookup(symbol) if stub is None: return apology("Invalid Symbol", 400) #pdb.set_trace() name, share_price, symbolo = stub no_shares_requested = request.form.get('shares') if not no_shares_requested.isdigit(): return apology("Only digits above 0", 400) #pdb.set_trace() no_shares_requested = int(no_shares_requested) total_amount = no_shares_requested * share_price balance = db.execute("SELECT cash FROM users WHERE username = :username", username=session['username']) cash = balance.get('cash') viable_balance = cash - total_amount if viable_balance >= 0: balance = db.execute( "INSERT INTO portfolio(username, user_id, symbol, name, shares, price,total, date ) values (:username,(SELECT id from users WHERE users.username= :username), :symbol, :name, :shares, :price, :amount, CURRENT_TIMESTAMP)", price=share_price, symbol=symbol, shares=no_shares_requested, username=session['username'], amount=total_amount, name=name) done = db.execute("UPDATE users SET cash = :viable_amount WHERE username = :username", viable_amount=viable_balance, username=session['username']) return index() else: return apology("no cash for that bud", 403)