瀏覽代碼

fix(patch): check if contact already exists for user

version-14
Sahil Khan 5 年之前
父節點
當前提交
30c6720398
共有 1 個檔案被更改,包括 2 行新增0 行删除
  1. +2
    -0
      frappe/patches/v11_0/create_contact_for_user.py

+ 2
- 0
frappe/patches/v11_0/create_contact_for_user.py 查看文件

@@ -17,6 +17,8 @@ def execute():

users = frappe.get_all('User', filters={"name": ('not in', 'Administrator, Guest')}, fields=["*"])
for user in users:
if frappe.db.exists("Contact", {"email_id": user.email}) or frappe.db.exists("Contact Email", {"email_id": user.email}):
continue
if user.first_name:
user.first_name = re.sub("[<>]+", '', frappe.safe_decode(user.first_name))
if user.last_name:


Loading…
取消
儲存