def password_reset_confirm(request, initial=False, extra_context={}, **kwargs):
extra_context.update({
'password_policy': password_validators_help_text_html()})
response = auth_views.password_reset_confirm(
request, extra_context=extra_context, **kwargs)
if isinstance(
response, HttpResponseRedirect) and response.status_code == 302:
# Send password change confirmation email
try:
uid = force_text(urlsafe_base64_decode(kwargs['uidb64']))
user = MunchUser.objects.get(pk=uid)
if initial:
user.send_invitation_complete_email()
else:
user.send_password_reset_complete_email()
except (TypeError, ValueError, OverflowError, MunchUser.DoesNotExist):
pass
return response
评论列表
文章目录