Procházet zdrojové kódy

Merge pull request #8590 from sahil28297/fix_create_contact

fix(patch): check if contact already exists for user
version-14
mergify[bot] před 5 roky
committed by GitHub
rodič
revize
849bbe1ca0
V databázi nebyl nalezen žádný známý klíč pro tento podpis ID GPG klíče: 4AEE18F83AFDEB23
1 změnil soubory, kde provedl 2 přidání a 0 odebrání
  1. +2
    -0
      frappe/patches/v11_0/create_contact_for_user.py

+ 2
- 0
frappe/patches/v11_0/create_contact_for_user.py Zobrazit soubor

@@ -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:


Načítá se…
Zrušit
Uložit