From 89e1bbe134bc770d4a3f999a1329bd07522b07cf Mon Sep 17 00:00:00 2001 From: Arnaud Bos Date: Wed, 14 Sep 2011 01:16:25 +0200 Subject: 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. --- budget/web.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'budget/web.py') 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) -- cgit v1.1