realy save password with the user_reset_password function
This commit is contained in:
parent
a42e352d2a
commit
8ad6ebfeee
@ -40,7 +40,6 @@ class Profile(models.Model):
|
|||||||
|
|
||||||
def reset_password(self):
|
def reset_password(self):
|
||||||
self.user.set_password(self.firstpassword)
|
self.user.set_password(self.firstpassword)
|
||||||
self.user.save()
|
|
||||||
|
|
||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
if self.group:
|
if self.group:
|
||||||
|
@ -300,9 +300,8 @@ def reset_password(request, user_id):
|
|||||||
user = User.objects.get(pk=user_id)
|
user = User.objects.get(pk=user_id)
|
||||||
if request.method == 'POST':
|
if request.method == 'POST':
|
||||||
user.profile.reset_password()
|
user.profile.reset_password()
|
||||||
user.profile.save()
|
|
||||||
messages.success(request, _('The Password for <b>%s</b> was successfully reset.') % user)
|
messages.success(request, _('The Password for <b>%s</b> was successfully reset.') % user)
|
||||||
else:
|
else:
|
||||||
gen_confirm_form(request, _('Do you really want to reset the password for <b>%s</b>?') % user,
|
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]))
|
return redirect(reverse('user_edit', args=[user_id]))
|
||||||
|
Loading…
Reference in New Issue
Block a user