1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/ihatemoney_ynh.git synced 2024-09-03 19:26:15 +02:00

fixes authentication (#9)

This commit is contained in:
Alexis Metaireau 2011-08-09 19:28:50 +02:00
parent 78914962ed
commit bdbc6361b9

View file

@ -35,12 +35,13 @@ def authenticate(redirect_url=None):
# propose him a link to the creation form. # propose him a link to the creation form.
create_project = project_id create_project = project_id
else:
# if credentials are already in session, redirect # if credentials are already in session, redirect
if project_id in session and project.password == session[project_id]: if project_id in session and project.password == session[project_id]:
return redirect(redirect_url) return redirect(redirect_url)
# else process the form # else process the form
if project and request.method == "POST": if request.method == "POST":
if form.validate(): if form.validate():
if not form.password.data == project.password: if not form.password.data == project.password:
form.errors['password'] = ["The password is not the right one"] form.errors['password'] = ["The password is not the right one"]