Skip to content

Commit

Permalink
fix change user password in admin page
Browse files Browse the repository at this point in the history
  • Loading branch information
panuta committed Sep 24, 2010
1 parent 12480ff commit 345b197
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions administration/views.py
Expand Up @@ -352,8 +352,9 @@ def view_administration_users_change_password(request, user_id):
if form.is_valid():
user.set_password(form.cleaned_data['password1'])
user.save()
set_message(request, u'ตั้งรหัสผ่านใหม่เรียบร้อย')
return redirect('view_administration_users_edit', (user.id))

messages.success(request, 'ตั้งรหัสผ่านใหม่เรียบร้อย')
return redirect('view_administration_users')

else:
form = UserChangePasswordForm()
Expand Down
Expand Up @@ -21,6 +21,8 @@ <h2>ตั้งรหัสผ่านใหม่</h2>
<div><a href="{% url view_administration_users %}">กลับไปหน้ารายชื่อผู้ใช้ &#187;</a></div>
{% else %}
<form action='.' method='POST' class="ss_form">
{% csrf_token %}

<ul>
<li>
<label for="id_password1" class="caption">{{form.password1.label}}{% display_required %}</label>
Expand Down

0 comments on commit 345b197

Please sign in to comment.