Questions tagged [finance]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
29 views

Pset9 Check50: buy handles valid purchase

I'm almost done with Finance but my solution doesn't pass the last tests of Check50. I'm stuck on the buy function. Check50 outputs the following: "buy handles valid purchase expected to find &...
  • 1
0 votes
1 answer
40 views

CS50 2023 Finance Check50 issue

There is no way to get rid of the following check50 error: :( logging in as registered user succeeds application raised an exception (see the log for more details) I found through googling that in ...
0 votes
1 answer
41 views

Finance app - object is not subscriptable

I have problems with pset 9 finance. Since days I try to figure out what is wrong with my code for the sell route. I know that there a handfull of similar questions on StackExchange/StackOverflow but ...
  • 5
0 votes
0 answers
32 views

Pset 9 Finance 'TypeError: 'NoneType' object is not subscriptable'

I'm currently doing Finance, for CS50x 2023, but I keep getting the same 'nonetype' object is not subscriptable error. I have tried to debug the error and found out that it is the user_id variable ...
0 votes
1 answer
74 views

expected to find "112.00" in page, but it wasn't found on PSET 9 - FINANCE

it is my first time asking here as I've tried various methods and solutions but still unable to solve this problem. I always get stuck on "buy handles valid purchase - expected to find "112....
0 votes
1 answer
31 views

What does "submit the user’s input via POST to /register" mean?

I'm doing "Finance" from Week 9. In register implementation, says: Submit the user’s input via POST to /register. I researched, but I can't understand what does that mean. I inserted the ...
  • 103
1 vote
1 answer
122 views

PSET9 Finance - Lookup function returns 402

I have been trouble shooting this for a while now. I have the Quote page working and I verified the stock symbol is being sent over correctly to the lookup function. I have done the export API_Key ...
0 votes
1 answer
148 views

PSET 9 Finance Index Function (jinja2.exceptions.UndefinedError: 'row' is undefined)

I have tried using dot notation in the index.html for loop. I referred to Lab 9 to check my syntax and ensure that I am passing variables correctly from app.py. I have also used flash(stock_rows[0][&...
0 votes
1 answer
50 views

CS50 PS9 finance :( buy exception raised in application: TypeError: '<' not supported between instances of 'str' and 'float'

@app.route("/buy", methods=["GET", "POST"]) @login_required def buy(): """Buy shares of stock""" if request.method == "GET": ...
0 votes
0 answers
12 views

Finance Pset trouble matching username in login function

still working on the Finance PSET here. I'm running into a problem where I'm not able to log in because the username is not recognized (even if the username exists). Here is my code for the login ...
0 votes
1 answer
39 views

Runtime error with Buy function

UPDATED: I've cleared up the runtime error caused by this code, so now it runs but it doesn't work correctly. I just get an apology back even if I submit a valid stock symbol and number of shares and ...
0 votes
1 answer
22 views

Pset9 Register function not working

Working through Pset9 and every time I try testing my register function I get back an image of a grumpy cat and a 403: Invalid username and/or password message. This is my code for the register ...
0 votes
0 answers
19 views

In 'Finance' how do I get the page to load?

I have not been able to get any page to load for the Finance problem (even without me messing about with it!). I tried deleting everything and starting again like so: $ wget https://cdn.cs50.net/2021/...
0 votes
0 answers
16 views

PSET 9 - Finance "TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'" during login/registration

Upon registration or login to Finance I am getting this error... I have finished all of the programming but since deleted all of the data in the SQL tables and tried to register a new user which is ...
0 votes
0 answers
24 views

PSET9 Finance: Register is not working because of index/ Error 405

def index(): """Show portfolio of stocks""" index_symbol = db.execute("SELECT symbol FROM stocks WHERE stock_id = ?", session["user_id"]) index_price =...
0 votes
1 answer
22 views

CS50 Problem set 9 - Finance - RuntimeError: foreign key mismatch - "holdings" referencing "users"

I'm facing a Runtime Error in /buy when I try to insert information about the stock into the holdings table. Here is my code for /buy: # Update holdings table db.execute("INSERT ...
0 votes
1 answer
61 views

check cs50 pset9 finance buy and sell errors

:( buy handles fractional, negative, and non-numeric shares expected status code 400, but got 200 :( buy handles valid purchase expected to find "112.00" in page, but it wasn't found :| sell ...
0 votes
0 answers
9 views

Flask run giving me an error

I just started the Problem set 9 "Finance", follow the steps to get the Token and then when i run flask flask run i get this page Is this an error or part of the problem set?
  • 103
0 votes
0 answers
42 views

PSET9 - SQL / table issue

I'm running into an issue with my code (sorta) for PSET9 that is driving me INSANE. I made a reddit post, which has helped me narrow down where my issue is, but I still need more guidance. https://www....
  • 1
0 votes
2 answers
86 views

CS50 Finance: Can't add time of transaction

I have managed to complete the rest of the history part except the time of transaction. I have tried several different ways to solve this problem, using data types like "DATETIME" or "...
  • 13
0 votes
0 answers
43 views

Check50 can't register but I can, Check50 can register with duplicate usernames but I can't

Been stuck on this for almost a month so I am getting a bit desperate. As the title says Check50 can't register but I can, and since I can't duplicate the problem I don't know how to fix it. :( ...
0 votes
0 answers
207 views

PSET9 finance 'buy handles valid purchase error, expected to find "112.00" in page, but it wasn't found'

I'm having issues figuring out why i'm running into this error. I've tried looking online and seeing what answers I could find but I'm stuck. Any help would be greatly appreciated. Error is: :( buy ...
0 votes
1 answer
381 views

Check50 is broken on Problem set 9 (Finance)

I made a previous very advanced version of Finance. But after checking it with check50, almost every checks failed. I decided to throw it all away and make a very scholar version of it, making ...
  • 101
0 votes
1 answer
68 views

check50 Finance "can't check until a frown turns upside down"

I have tested the code manually and everything works fine app.py: import os from cs50 import SQL from flask import Flask, flash, redirect, render_template, request, session from flask_session import ...
0 votes
1 answer
62 views

CS50 Finance check50 giving 400 error despite working well

I have coded the CS50 Finance problem set and it seems to be working fine from my end. However, check50 throws a 400 error for Post request on /register. Even in the console, I don't see that error. ...
0 votes
1 answer
93 views

Finance index.html is not displaying any data at all

I am stuck on index() in finance. I have a working SQL function which compiles all the transactions made by the user and sums the shares of all the repeating stocks - ie creating a list of owned ...
0 votes
0 answers
105 views

pset9 finance :( buy handles valid purchase

I've been trying to figure out why I keep getting the error message for buy. Below is the error log: sending GET request to /signin sending POST request to /login sending POST request to /buy checking ...
0 votes
1 answer
6 views

Finance - Quote: Toggle visibility between submit button and table

I'm happy that my finance website finally works properly!!! The thing is that I'm trying to make it look like the staff's solution website and I can't seem to get quote.html to behave like theirs (...
  • 3
0 votes
1 answer
206 views

CS50 Finance ValueError: FOREIGN KEY constraint failed

this error has getting me for a while now. From what I researched, it commonly occurs when inserting a wrong type in a column field or a value in the wrong order. Even though it appears in check50, I ...
0 votes
0 answers
26 views

Finance Index: Lookup won't accept subscripted argument

I'm working on index in finance. This is my code: @app.route("/") @login_required def index(): id = session["user_id"] stocks = db.execute("SELECT symbol, SUM(shares) ...
0 votes
0 answers
113 views

Help wanted. Trying to make a table using a loop in jinja

My name is Sol and I'm kinda new here. I'm trying to finish my CS50 PSET 7 and I got stuck. Both in index.html and history.html I have the same problem. I'm trying to populate a table with info taken ...
  • 3
0 votes
0 answers
70 views

pset9 Finance Check50 bot says submission button not found

I have completed my application for pset9 and have all functions working properly, however check50 doesn't agree with my register implementation. Apparently, I do not have a submission button, however ...
0 votes
1 answer
62 views

PSET9 FINANCE SQLITE "no such column exists" while multiplying two columns to update a third

In the Index function on APP.PY of my finance code, I'm getting "RuntimeError: no such column: total_per_share" even though I'm using "AS" to create this column -- please advise. @...
1 vote
1 answer
136 views

cs50 finance - RuntimeError: unsupported value: <function buy at 0x7f1c380cfd90>

@app.route("/buy", methods=["GET", "POST"]) @login_required def buy(): """Buy shares of stock""" if request.method == "POST": ...
  • 15
0 votes
0 answers
956 views

Here is my cs50 finance /buy code

@app.route("/buy", methods=["GET", "POST"]) @login_required def buy(): """Buy shares of stock""" if request.method == "POST": ...
  • 15
0 votes
1 answer
103 views

my cs50 finance buy do not update in in the portfolio

i have tried so many options but to no avail pls below are the code i wrote.`@app.route("/buy", methods=["GET", "POST"]) @login_required def buy(): """Buy ...
  • 15
0 votes
1 answer
28 views

PSET 9: C$50 Finance. Why not <input type="number"> instead of text?

From CS50's Problem Set 9 specification: Require that a user input a number of shares, implemented as a text field whose name is shares. Render an apology if the input is not a positive integer. I'm ...
0 votes
1 answer
196 views

400 error on login after 302 redirect

I am getting a 400 error after opening the site, e.g., https://USERNAME-code50-#######-#########-5000.githubpreview.dev/. From the network request log I see a 302 redirect to https://github.com/...
0 votes
1 answer
91 views

Flask/Python PSET9 Finance -- Using PRINT() to debug

Having some problems with INDEX that I figure printing variable content to console will help me solve. BUT no matter what I try, print(variable) doesn't result in anything at all on the console/...
0 votes
1 answer
240 views

ValueError: UNIQUE constraint failed: on finance pset9, could someone point me in the right direction on which values should be UNIQUE from my table?

Could someone help me figure out which values should I define as UNIQUE? I'm getting the ValueError: UNIQUE constraint failed: compras.id beacuase of the way I created my table for keeping tab of who ...
0 votes
1 answer
69 views

FINANCE SELL : DROPDOWN MENU not showing any option DESPITE having look for solutions

This is my first time posting on reddit asking for help : I've been so far going through cs50 on ressources online when I got stuck, but here I can't figure it out even tho with the numerous online ...
  • 1
0 votes
1 answer
219 views

PSET9 Finance- Check50 error - sell page has all required elements - expected to find input field with name "shares", but none found

I get an error when I run the check50 command for Finance problem set. The sell.html template is below: {% extends "layout.html" %} {% block title %} Sell {% endblock %} {% block main %...
0 votes
1 answer
569 views

PSET9 Finance - Check50 Failing on login - logging in as registered user succceeds - IndexError: list index out of range

I have been struggling with the Finance problem for a while. Upon running the check50 command, I get the following error: :( logging in as registered user succceeds Cause application raised an ...
0 votes
1 answer
24 views

Key error(hash) in login function

If len (rows) != 1 or not check_password_hash (rows [0]["hash"], request.form.get ("password")): Return apology ("invalid username and/or password") The following ...
0 votes
0 answers
106 views

The predefined login function psets/9/finance error

Have a problem with check50. I'm able to register, log in and all but check50 keeps denying it (the login part): :) application.py exists checking that application.py exists... :) application ...
0 votes
1 answer
108 views

Cs50 Finance :(sell handle valid sales :values appearing in index table but check50 doesnt recognise it

updated the code to display history properly,ie when sold shows negative,and when bought shows positive updated index to remove entire row when stocks is 0 I cant figure out why check 50 is not ...
  • 1
0 votes
0 answers
37 views

NameError in Pset: Finance

Cause application raised an exception (see the log for more details) Log sending POST request to /login sending POST request to /buy exception raised in application: NameError: name 'stock' is not ...
0 votes
1 answer
112 views

Getting error in pset8 Finance

I get this error in register in pset8/finance when I run check50: :) application.py exists :) application starts up :) register page has all required elements :( registering user succeeds expected ...
0 votes
1 answer
262 views

Check50 says buy allows fractional, negative numbers but it doesn't. Where am I going wrong?

I'm down to my last check50 frown (:( buy handles fractional, negative, and non-numeric shares expected status code 400, but got 200) but my code doesn't allow for these, so I don't know what to do. ...
  • 14
0 votes
0 answers
254 views

CS50 Week9 Finance I have an error in register

I'm struggling with register function in application.py since I am having error messages in check50 That says: :) register page has all required elements :( registering user succeeds expected ...
  • 1

1
2 3 4 5
10