aboutsummaryrefslogtreecommitdiff
path: root/budget/web.py
diff options
context:
space:
mode:
authorAlexis Metaireau <alexis@notmyidea.org>2011-08-25 18:25:58 +0200
committerAlexis Metaireau <alexis@notmyidea.org>2011-08-25 18:25:58 +0200
commit0303ab4db7fde0f663fd669d3d3f8f5e5800774f (patch)
treebe6df3adf369b09cf1afb6b8df3cdd238bf377f5 /budget/web.py
parent3f8cabd5a85af7b6a965137929874d9e0caaf35a (diff)
downloadihatemoney-mirror-0303ab4db7fde0f663fd669d3d3f8f5e5800774f.zip
ihatemoney-mirror-0303ab4db7fde0f663fd669d3d3f8f5e5800774f.tar.gz
ihatemoney-mirror-0303ab4db7fde0f663fd669d3d3f8f5e5800774f.tar.bz2
Add a way to reactivate an user, make the add project non obstrusive
Diffstat (limited to 'budget/web.py')
-rw-r--r--budget/web.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/budget/web.py b/budget/web.py
index 4724baa..be5b1e9 100644
--- a/budget/web.py
+++ b/budget/web.py
@@ -187,6 +187,17 @@ def add_member():
return redirect(url_for("list_bills"))
return render_template("add_member.html", form=form)
+@app.route("/<project_id>/members/<member_id>/reactivate", methods=["GET",])
+def reactivate(member_id):
+ person = Person.query.filter(Person.id == member_id)\
+ .filter(Project.id == g.project.id).all()
+ if person:
+ person[0].activated = True
+ db.session.commit()
+ flash("%s is part of this project again" % person[0].name)
+ return redirect(url_for("list_bills"))
+
+
@app.route("/<project_id>/members/<member_id>/delete", methods=["GET", "POST"])
def remove_member(member_id):
person = Person.query.get_or_404(member_id)