Commit 32b1faf8 authored by David Mudrák's avatar David Mudrák Committed by David Monllaó

MDL-64205 users: Do not delete the actual records of unconfirmed users

There is an automatic data privacy request created to get rid of all the
personal data upon the user deletion. With the actual user record
absent, the data privacy requests page throws an error. Let's do here
same as we do in `delete_incomplete_users_task` and let us not delete
the actual user record.
parent f66db7a5
......@@ -54,9 +54,8 @@ class delete_unconfirmed_users_task extends scheduled_task {
WHERE confirmed = 0 AND timecreated > 0
AND timecreated < ? AND deleted = 0", array($cuttime));
foreach ($rs as $user) {
delete_user($user); // We MUST delete user properly first.
$DB->delete_records('user', array('id' => $user->id)); // This is a bloody hack, but it might work.
mtrace(" Deleted unconfirmed user for ".fullname($user, true)." ($user->id)");
mtrace(" Deleted unconfirmed user ".fullname($user, true)." ($user->id)");
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment