Merge branch 'MDL-64570-master' of git://github.com/damyon/moodle
[moodle.git] / user / lib.php
index e170a23..63b94c9 100644 (file)
@@ -126,8 +126,9 @@ function user_create_user($user, $updatepassword = true, $triggerevent = true) {
         \core\event\user_created::create_from_userid($newuserid)->trigger();
     }
 
         \core\event\user_created::create_from_userid($newuserid)->trigger();
     }
 
-    // Purge the associated caches.
-    cache_helper::purge_by_event('createduser');
+    // Purge the associated caches for the current user only.
+    $presignupcache = \cache::make('core', 'presignup');
+    $presignupcache->purge_current_user();
 
     return $newuserid;
 }
 
     return $newuserid;
 }