1
0
mirror of https://github.com/moodle/moodle.git synced 2025-03-21 16:10:15 +01:00

MDL-62397 tool_dataprivacy: Check for inactive status properly

This commit is contained in:
Andrew Nicols 2018-05-11 11:20:19 +08:00
parent 02c7769422
commit ddb1a13573

@ -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;
}