MDL-65085 analytics: noreply user sends insights
authorDavid Monllaó <davidm@moodle.com>
Fri, 15 Mar 2019 12:04:13 +0000 (13:04 +0100)
committerDavid Monllaó <davidm@moodle.com>
Fri, 15 Mar 2019 12:48:57 +0000 (13:48 +0100)
analytics/classes/local/target/base.php

index 638b18b..142518e 100644 (file)
@@ -196,7 +196,7 @@ abstract class base extends \core_analytics\calculable {
                 $message->component = 'moodle';
                 $message->name = 'insights';
 
-                $message->userfrom = get_admin();
+                $message->userfrom = \core_user::get_noreply_user();
                 $message->userto = $user;
 
                 $insighturl = new \moodle_url('/report/insights/insights.php?modelid=' . $modelid . '&contextid=' . $context->id);