[snowy] display a message when a user successfully changes their password
- From: Jeff Schroeder <jschroeder src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [snowy] display a message when a user successfully changes their password
- Date: Sun, 19 Dec 2010 23:55:44 +0000 (UTC)
commit 1faccac70e7f3f5f31f9c4a4c23808b5ce0245f8
Author: Natan Yellin <aantny gmail com>
Date: Wed Dec 15 17:24:44 2010 +0200
display a message when a user successfully changes their password
accounts/templates/accounts/preferences.html | 8 ++++++++
accounts/views.py | 1 +
2 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/accounts/templates/accounts/preferences.html b/accounts/templates/accounts/preferences.html
index 39c0e2a..931ea9a 100644
--- a/accounts/templates/accounts/preferences.html
+++ b/accounts/templates/accounts/preferences.html
@@ -3,6 +3,14 @@
{% load i18n %}
{% block content %}
+
+{% if messages %}
+{% for message in messages %}
+<div{% if message.tags %} class="{{ message.tags }} center"{% endif %} style="color: red;">{{ message }}</div>
+<br />
+{% endfor %}
+{% endif %}
+
<h1>{% trans "Preferences" %}</h1>
{% if user.has_usable_password %}
<h3>{% trans "Change your password" %}</h3>
diff --git a/accounts/views.py b/accounts/views.py
index f43fd99..a9d48ac 100644
--- a/accounts/views.py
+++ b/accounts/views.py
@@ -115,6 +115,7 @@ def accounts_preferences(request, template_name='accounts/preferences.html'):
password_form = PasswordChangeForm(user, data=request.POST)
if password_form.is_valid():
password_form.save()
+ messages.add_message(request, messages.SUCCESS, _("Password changed"))
else:
password_form = PasswordChangeForm(user)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]