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

Bugfix : error when you access /authenticate url without a project identifier

This commit is contained in:
A.Avenel 2013-06-23 17:37:58 +02:00
parent a71d249e6c
commit 8b64762f71

View file

@ -72,7 +72,12 @@ def authenticate(project_id=None):
if not form.id.data and request.args.get('project_id'): if not form.id.data and request.args.get('project_id'):
form.id.data = request.args['project_id'] form.id.data = request.args['project_id']
project_id = form.id.data project_id = form.id.data
project = False
if project_id:
project = Project.query.get(project_id) project = Project.query.get(project_id)
else:
msg = _("You need to enter a project identifier")
form.errors["id"] = [msg]
create_project = False # We don't want to create the project by default create_project = False # We don't want to create the project by default
if not project: if not project:
# But if the user try to connect to an unexisting project, we will # But if the user try to connect to an unexisting project, we will