I'm currently working on pset7, cs50 finance. I just implemented the buy method, and when I went to login on my site, I encountered a key error, pointing to 'id' in the following line in the login method:
session["user_id"] = rows["id"]
Strangely enough, login was implemented by staff, so I don't know what could possibly be wrong with it. The same error appears when I try to register, only with a similar line in my register method. My website was working fine before I implemented buy. My only fear is that I might have altered an index in users when creating my portfolio table; I tried to make an index in portfolio by the name of username, unknowing that an index was also named username in users. I dismissed the error message, but I realize now that I still might have unknowingly changed the index in users. If this is indeed the problem, how could I change the index in users back? If not, what else might I be doing wrong?