Merge branch 'MDL-62397-master' of git://github.com/andrewnicols/moodle
authorDavid Monllao <davidm@moodle.com>
Fri, 11 May 2018 11:14:05 +0000 (13:14 +0200)
committerDavid Monllao <davidm@moodle.com>
Fri, 11 May 2018 11:14:05 +0000 (13:14 +0200)
admin/tool/dataprivacy/classes/task/process_data_request_task.php

index 6148f01..bacf29a 100644 (file)
@@ -68,8 +68,9 @@ class process_data_request_task extends adhoc_task {
         $request = $requestpersistent->to_record();
 
         // Check if this request still needs to be processed. e.g. The user might have cancelled it before this task has run.
-        if ($request->status != api::DATAREQUEST_STATUS_APPROVED) {
-            mtrace("Request {$request->id} hasn\'t been approved yet or it has already been processed. Skipping...");
+        $status = $requestpersistent->get('status');
+        if (!api::is_active($status)) {
+            mtrace("Request {$requestid} with status {$status} doesn't need to be processed. Skipping...");
             return;
         }