Explorar el Código

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

version-14
Sahil Khan hace 5 años
padre
commit
30c6720398
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  1. +2
    -0
      frappe/patches/v11_0/create_contact_for_user.py

+ 2
- 0
frappe/patches/v11_0/create_contact_for_user.py Ver fichero

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


users = frappe.get_all('User', filters={"name": ('not in', 'Administrator, Guest')}, fields=["*"]) users = frappe.get_all('User', filters={"name": ('not in', 'Administrator, Guest')}, fields=["*"])
for user in users: 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: if user.first_name:
user.first_name = re.sub("[<>]+", '', frappe.safe_decode(user.first_name)) user.first_name = re.sub("[<>]+", '', frappe.safe_decode(user.first_name))
if user.last_name: if user.last_name:


Cargando…
Cancelar
Guardar