aboutsummaryrefslogtreecommitdiff
path: root/budget/web.py
diff options
context:
space:
mode:
authorAlexis Metaireau <alexis@notmyidea.org>2011-08-20 00:24:00 +0200
committerAlexis Metaireau <alexis@notmyidea.org>2011-08-20 00:24:00 +0200
commit3c4d87ae524dd85176faa50fb98f3001b13c14c2 (patch)
treec02142e7df7e12dc39375d94db54807bfd4964f5 /budget/web.py
parent28a3abf96d010db8253b53933d6ab36c4dd412d9 (diff)
downloadihatemoney-mirror-3c4d87ae524dd85176faa50fb98f3001b13c14c2.zip
ihatemoney-mirror-3c4d87ae524dd85176faa50fb98f3001b13c14c2.tar.gz
ihatemoney-mirror-3c4d87ae524dd85176faa50fb98f3001b13c14c2.tar.bz2
forgot to commit changes to web.py
Diffstat (limited to 'budget/web.py')
-rw-r--r--budget/web.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/budget/web.py b/budget/web.py
index 14e058c..1329dbe 100644
--- a/budget/web.py
+++ b/budget/web.py
@@ -31,10 +31,9 @@ def home():
auth_form=auth_form, session=session)
@app.route("/authenticate", methods=["GET", "POST"])
-def authenticate(redirect_url=None):
+def authenticate(redirect_url=None, project_id=None):
form = AuthenticationForm()
-
- project_id = form.id.data
+ project_id = form.id.data or request.args['project_id']
project = Project.query.get(project_id)
create_project = False # We don't want to create the project by default
if not project:
@@ -111,14 +110,15 @@ def pull_project(endpoint, values):
if project_id:
project = Project.query.get(project_id)
if not project:
- raise RequestRedirect(url_for("create_project"))
+ raise RequestRedirect(url_for("create_project", project_id=project_id))
if project.id in session and session[project.id] == project.password:
# add project into kwargs and call the original function
g.project = project
else:
# redirect to authentication page
raise RequestRedirect(
- url_for("authenticate", redirect_url=request.url))
+ url_for("authenticate", redirect_url=request.url,
+ project_id=project_id))
@app.route("/<project_id>/invite", methods=["GET", "POST"])
def invite():