fix: on hold status for data deletion
This commit is contained in:
parent
e57d2d0aa2
commit
c5c439ff03
2 changed files with 17 additions and 18 deletions
|
|
@ -27,8 +27,7 @@
|
|||
"in_list_view": 1,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Status",
|
||||
"options": "Pending Verification\nPending Approval\nDeleted",
|
||||
"read_only": 1
|
||||
"options": "Pending Verification\nPending Approval\nOn Hold\nDeleted"
|
||||
},
|
||||
{
|
||||
"fieldname": "anonymization_matrix",
|
||||
|
|
@ -45,7 +44,7 @@
|
|||
}
|
||||
],
|
||||
"links": [],
|
||||
"modified": "2021-12-15 19:34:22.280235",
|
||||
"modified": "2021-12-16 10:00:24.165897",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Website",
|
||||
"name": "Personal Data Deletion Request",
|
||||
|
|
|
|||
|
|
@ -336,6 +336,21 @@ class PersonalDataDeletionRequest(Document):
|
|||
{"name": self.full_name, "email": self.email},
|
||||
)
|
||||
|
||||
def auto_delete(self):
|
||||
auto_account_deletion = frappe.db.get_single_value("Website Settings", "auto_account_deletion")
|
||||
if auto_account_deletion < 1:
|
||||
return
|
||||
|
||||
requests = frappe.get_all("Personal Data Deletion Request",
|
||||
filters = {
|
||||
"status": "Pending Approval"
|
||||
},
|
||||
fields = ["name", "creation", "status"])
|
||||
|
||||
for request in requests:
|
||||
if date_diff(get_datetime(), request.creation) >= auto_account_deletion:
|
||||
self.trigger_data_deletion()
|
||||
|
||||
|
||||
def remove_unverified_record():
|
||||
frappe.db.sql(
|
||||
|
|
@ -345,21 +360,6 @@ def remove_unverified_record():
|
|||
AND `creation` < (NOW() - INTERVAL '7' DAY)"""
|
||||
)
|
||||
|
||||
def auto_delete():
|
||||
auto_account_deletion = frappe.db.get_single_value("Website Settings", "auto_account_deletion")
|
||||
if auto_account_deletion < 1:
|
||||
return
|
||||
|
||||
requests = frappe.get_all("Personal Data Deletion Request",
|
||||
filters = {
|
||||
"status": "Pending Approval"
|
||||
},
|
||||
fields = ["name", "creation", "status"])
|
||||
|
||||
for request in requests:
|
||||
if date_diff(get_datetime(), request.creation) >= auto_account_deletion:
|
||||
self.trigger_data_deletion()
|
||||
|
||||
@frappe.whitelist(allow_guest=True)
|
||||
def confirm_deletion(email, name, host_name):
|
||||
if not verify_request():
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue