Merge pull request #8590 from sahil28297/fix_create_contact
fix(patch): check if contact already exists for user
This commit is contained in:
commit
849bbe1ca0
1 changed files with 2 additions and 0 deletions
|
|
@ -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…
Add table
Reference in a new issue