fix: Use site domain for deleted user name

* Use strict option for Comment
This commit is contained in:
Gavin D'souza 2021-03-04 12:35:37 +05:30
parent c577297b6f
commit b8f962fd8f
3 changed files with 9 additions and 5 deletions

View file

@ -295,7 +295,7 @@ otp_methods = ['OTP App','Email','SMS']
user_data_fields = [
{"doctype": "Access Log", "strict": True},
{"doctype": "Activity Log", "strict": True},
{"doctype": "Comment"},
{"doctype": "Comment", "strict": True},
{
"doctype": "Contact",
"filter_by": "email_id",

View file

@ -1,6 +1,5 @@
{
"actions": [],
"autoname": "format:deleted-user-{####}@deleted.com",
"creation": "2019-02-12 15:11:52.201733",
"doctype": "DocType",
"editable_grid": 1,
@ -31,7 +30,7 @@
}
],
"links": [],
"modified": "2021-02-26 00:11:22.434940",
"modified": "2021-02-28 12:36:08.219719",
"modified_by": "Administrator",
"module": "Website",
"name": "Personal Data Deletion Request",

View file

@ -24,6 +24,11 @@ class PersonalDataDeletionRequest(Document):
x for x in self.user_data_fields if x.get("partial") or not x.get("redact_fields")
]
def autoname(self):
from frappe.model.naming import set_name_from_naming_options
autoname = f"format:deleted-user-{{####}}@{frappe.local.site}"
set_name_from_naming_options(autoname, self)
def after_insert(self):
self.send_verification_mail()
@ -86,8 +91,8 @@ class PersonalDataDeletionRequest(Document):
self.is_full_name_set = email != self.full_name
self.anonymization_value_map = {
"Code": "REDACTED: Removed due to Personal Data Deletion Request",
"Data": "REDACTED",
"Code": "[REDACTED]: Removed due to Personal Data Deletion Request",
"Data": "[REDACTED]",
"Date": "1111-01-01",
"Email": self.anon,
"Int": 0,