realy save password with the user_reset_password function

This commit is contained in:
Oskar Hahn 2011-09-07 14:21:42 +02:00
parent a42e352d2a
commit 8ad6ebfeee
2 changed files with 1 additions and 3 deletions

View File

@ -40,7 +40,6 @@ class Profile(models.Model):
def reset_password(self):
self.user.set_password(self.firstpassword)
self.user.save()
def __unicode__(self):
if self.group:

View File

@ -300,9 +300,8 @@ def reset_password(request, user_id):
user = User.objects.get(pk=user_id)
if request.method == 'POST':
user.profile.reset_password()
user.profile.save()
messages.success(request, _('The Password for <b>%s</b> was successfully reset.') % user)
else:
gen_confirm_form(request, _('Do you really want to reset the password for <b>%s</b>?') % user,
reverse('user_overview'))
reverse('user_reset_passwords', args=[user_id]))
return redirect(reverse('user_edit', args=[user_id]))