From 55d91bbcf5bade010ef901537ec9b9b804a5dbe4 Mon Sep 17 00:00:00 2001 From: Ameya Shenoy Date: Mon, 28 May 2018 11:03:30 +0530 Subject: [PATCH] [fix] creates contact even in presence of bad char (#5618) --- frappe/patches/v11_0/create_contact_for_user.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frappe/patches/v11_0/create_contact_for_user.py b/frappe/patches/v11_0/create_contact_for_user.py index 3dc8b41d33..86fc62cbff 100644 --- a/frappe/patches/v11_0/create_contact_for_user.py +++ b/frappe/patches/v11_0/create_contact_for_user.py @@ -10,6 +10,6 @@ def execute(): users = frappe.get_all('User', filters={"name": ('not in', 'Administrator, Guest')}, fields=["*"]) special_characters = "<>" for user in users: - if re.findall("[{0}]+".format(special_characters), user.full_name): - continue + user.first_name = re.sub("[{0}]+".format(special_characters), '', str(user.first_name)) + user.last_name = re.sub("[{0}]+".format(special_characters), '', str(user.last_name)) create_contact(user)