From 49015e6d1a4c8670172ea00776e168f6cec0092b Mon Sep 17 00:00:00 2001 From: Brian Beggs Date: Thu, 1 Nov 2018 10:37:08 -0400 Subject: [PATCH] Reset learners password when user is unGDPRed/unretired via django admin. --- openedx/core/djangoapps/user_api/accounts/forms.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/openedx/core/djangoapps/user_api/accounts/forms.py b/openedx/core/djangoapps/user_api/accounts/forms.py index 8dae89caf4..e86262a4ff 100644 --- a/openedx/core/djangoapps/user_api/accounts/forms.py +++ b/openedx/core/djangoapps/user_api/accounts/forms.py @@ -4,6 +4,7 @@ Django forms for accounts from django import forms from django.core.exceptions import ValidationError +from openedx.core.djangoapps.user_api.accounts.utils import generate_password class RetirementQueueDeletionForm(forms.Form): @@ -33,6 +34,8 @@ class RetirementQueueDeletionForm(forms.Form): # Load the user record using the retired email address -and- change the email address back. retirement.user.email = retirement.original_email + # Reset users password so they can request a password reset and log in again. + retirement.user.set_password(generate_password(length=25)) retirement.user.save() # Delete the user retirement status record.