Skip to content
Snippets Groups Projects
Commit 4a006692 authored by Harry Hughes's avatar Harry Hughes
Browse files

Replace routes.py

parent 5f13a1d5
No related branches found
No related tags found
No related merge requests found
......@@ -87,7 +87,7 @@ def account():
def register():
form = RegistrationForm()
if form.validate_on_submit():
user = User(username=form.username.data, email=form.email.data, password=form.password_hash.data)
user = User(username=form.username.data, email=form.email.data, password=form.password.data)
db.session.add(user)
db.session.commit()
flash('Registration successful!')
......@@ -103,7 +103,7 @@ def login():
form = LoginForm()
if form.validate_on_submit():
user = User.query.filter_by(username=form.username.data).first()
if user and (user.password_hash, form.password_hash.data):
if user and (user.password, form.password.data):
login_user(user)
flash('You\'ve successfully logged in,'+' '+ current_user.username +'!')
return redirect(url_for('home'))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment