mirror of
https://github.com/YunoHost-Apps/ihatemoney_ynh.git
synced 2024-09-03 19:26:15 +02:00
forgot to commit changes to web.py
This commit is contained in:
parent
28a3abf96d
commit
3c4d87ae52
1 changed files with 5 additions and 5 deletions
|
@ -31,10 +31,9 @@ def home():
|
||||||
auth_form=auth_form, session=session)
|
auth_form=auth_form, session=session)
|
||||||
|
|
||||||
@app.route("/authenticate", methods=["GET", "POST"])
|
@app.route("/authenticate", methods=["GET", "POST"])
|
||||||
def authenticate(redirect_url=None):
|
def authenticate(redirect_url=None, project_id=None):
|
||||||
form = AuthenticationForm()
|
form = AuthenticationForm()
|
||||||
|
project_id = form.id.data or request.args['project_id']
|
||||||
project_id = form.id.data
|
|
||||||
project = Project.query.get(project_id)
|
project = Project.query.get(project_id)
|
||||||
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:
|
||||||
|
@ -111,14 +110,15 @@ def pull_project(endpoint, values):
|
||||||
if project_id:
|
if project_id:
|
||||||
project = Project.query.get(project_id)
|
project = Project.query.get(project_id)
|
||||||
if not project:
|
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:
|
if project.id in session and session[project.id] == project.password:
|
||||||
# add project into kwargs and call the original function
|
# add project into kwargs and call the original function
|
||||||
g.project = project
|
g.project = project
|
||||||
else:
|
else:
|
||||||
# redirect to authentication page
|
# redirect to authentication page
|
||||||
raise RequestRedirect(
|
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"])
|
@app.route("/<project_id>/invite", methods=["GET", "POST"])
|
||||||
def invite():
|
def invite():
|
||||||
|
|
Loading…
Add table
Reference in a new issue