Closed alexander-bauer closed 7 years ago
Hey @alexander-bauer, I've implemented this, but I'm unsure of if its been implement correctly (Latest Git Update). Few questions. It might be better to talk through this in person but I'll post here too.
@Mjacks3 I was actually pretty unclear on the makeadmin
function, sorry! I meant that you should borrow the code from that function, rather than calling the function directly. We should remove that function as soon as we have another method to create the first admin.
As for the SQLite3 command, you can either open another terminal simultaneously, or run the SELECT command after stopping the Flask process. That command just queries the database, which persists.
Retroactively closing
General process:
UserInfo
form incollegejump/forms.py
User
model incollegejump/models.py
. Don't take the ID from the form, and also use aPasswordField
from WTForms. We can leave the mentor stuff for later. We want the name, email, and admin fields.login.html
for an example.views.py
to pass the semantic form info (see nearform = LoginForm()
fromviews.py
) to the templateviews.py
function to accept thePOST
method, as with the login form, and use theform.validate_on_submit()
block to do the logic on receiving the form.makeadmin
in__main__.py
for creating the user.Bear in mind that the login is buggy at the moment, so testing might be a pain. To check what's in the User table in the database, you can use
sqlite3 local.db 'SELECT * FROM user;'
.