MDL-64030 tool_dataprivacy: Process requests when system purpose not set

This commit is contained in:
Andrew Nicols
2018-11-23 07:54:20 +08:00
parent 56d8e413ba
commit b78c5102ac
5 changed files with 119 additions and 7 deletions
@@ -74,11 +74,9 @@ class process_data_request_task extends adhoc_task {
return;
}
// If no site purpose is defined, reject requests since they cannot be processed.
if (!\tool_dataprivacy\data_registry::defaults_set()) {
api::update_request_status($requestid, api::DATAREQUEST_STATUS_REJECTED);
mtrace('No site purpose defined. Request ' . $requestid . ' rejected.');
return;
// Warn if no site purpose is defined.
mtrace('Warning: No purpose is defined at the system level. Deletion will delete all.');
}
// Get the user details now. We might not be able to retrieve it later if it's a deletion processing.