Commit 8d1a9a75 authored by danmcquillan's avatar danmcquillan

vs_url_for fix

parent 8323d736
......@@ -130,17 +130,16 @@ def delete_twit():
def login():
form = loginForm()
if form.validate_on_submit():
password = form.password.data
username = form.username.data
# get the user object via sqlalchemy
user = Users.query.filter_by(username=username).first()
# use the password helper to validate the password
if ph.validate_password(password,user.salt,user.hashed):
login_user(user)
flash('successfully logged in as {}'.format(user.username))
return redirect(url_for('index'))
else:
flash('please try again')
password = form.password.data
username = form.username.data
# get the user object via sqlalchemy
user = Users.query.filter_by(username=username).first()
# use the password helper to validate the password
if ph.validate_password(password,user.salt,user.hashed):
login_user(user)
return redirect(vs_url_for('index'))
else:
flash('please try again')
return render_template('login.html',form=form)
......
from flask import url_for
#URL_PREFIX = '/usr/253'
URL_PREFIX = ''
URL_PREFIX = '/usr/253'
def vs_url_for(view):
url = url_for(view)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment