diff options
| author | Arnaud Bos <arnaud.tlse@gmail.com> | 2011-09-14 02:07:26 +0200 |
|---|---|---|
| committer | Arnaud Bos <arnaud.tlse@gmail.com> | 2011-09-14 02:07:26 +0200 |
| commit | 34ccb3546d2d1cb15e3bc4f5524a2c7630dc2182 (patch) | |
| tree | e14c444b88dc70bf01132b19c76b7a8faed76c32 /budget | |
| parent | b0d41291afade8aec86502d07d1d29d000ff1bca (diff) | |
| download | ihatemoney-mirror-34ccb3546d2d1cb15e3bc4f5524a2c7630dc2182.zip ihatemoney-mirror-34ccb3546d2d1cb15e3bc4f5524a2c7630dc2182.tar.gz ihatemoney-mirror-34ccb3546d2d1cb15e3bc4f5524a2c7630dc2182.tar.bz2 | |
Validate authentication form if given identifier is null. Fix #30.
Diffstat (limited to 'budget')
| -rw-r--r-- | budget/web.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/budget/web.py b/budget/web.py index 5667b05..3527a75 100644 --- a/budget/web.py +++ b/budget/web.py @@ -63,7 +63,7 @@ def pull_project(endpoint, values): def authenticate(project_id=None): """Authentication form""" form = AuthenticationForm() - if not form.id.data and request.args['project_id']: + if not form.id.data and request.args.get('project_id'): form.id.data = request.args['project_id'] project_id = form.id.data project = Project.query.get(project_id) @@ -71,7 +71,11 @@ def authenticate(project_id=None): if not project: # But if the user try to connect to an unexisting project, we will # propose him a link to the creation form. - create_project = project_id + if not project_id: + if request.method == "POST": + form.validate() + else: + create_project = project_id else: # if credentials are already in session, redirect |
