diff options
| author | Arnaud Bos <arnaud.tlse@gmail.com> | 2011-09-14 01:16:25 +0200 |
|---|---|---|
| committer | Arnaud Bos <arnaud.tlse@gmail.com> | 2011-09-14 01:16:25 +0200 |
| commit | 89e1bbe134bc770d4a3f999a1329bd07522b07cf (patch) | |
| tree | 818f77883e6c756bcd1e797af7868c40cba97e00 /budget/web.py | |
| parent | 88cd2f86751621d73574ac56a9d6c4bedcbdd3d5 (diff) | |
| download | ihatemoney-mirror-89e1bbe134bc770d4a3f999a1329bd07522b07cf.zip ihatemoney-mirror-89e1bbe134bc770d4a3f999a1329bd07522b07cf.tar.gz ihatemoney-mirror-89e1bbe134bc770d4a3f999a1329bd07522b07cf.tar.bz2 | |
Make the identifier clearer to the end-user.
- Send an email to the user with the summary of the created project
containing a reminder of the identifier, password and a link.
- Add flash message with the identifier in the /invite page/
- Add a small note containing the identifier in the upper right corner
of the project main page.
Diffstat (limited to 'budget/web.py')
| -rw-r--r-- | budget/web.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/budget/web.py b/budget/web.py index cb8c4ac..6b3a01c 100644 --- a/budget/web.py +++ b/budget/web.py @@ -82,7 +82,7 @@ def authenticate(project_id=None): if request.method == "POST": if form.validate(): if not form.password.data == project.password: - form.errors['password'] = ["The password is not the right one"] + form.errors['password'] = ["This private code is not the right one"] else: # maintain a list of visited projects if "projects" not in session: @@ -127,7 +127,20 @@ def create_project(): session[project.id] = project.password session.update() + # send reminder email + g.project = project + + message_title = "You have just created '%s' to share your expenses" % g.project.name + + message_body = render_template("reminder_mail") + + msg = Message(message_title, + body=message_body, + recipients=[project.contact_email]) + mail.send(msg) + # redirect the user to the next step (invite) + flash("The project identifier is %s" % project.id) return redirect(url_for(".invite", project_id=project.id)) return render_template("create_project.html", form=form) |
