[fix] creates contact even in presence of bad char (#5618)

This commit is contained in:
Ameya Shenoy 2018-05-28 11:03:30 +05:30 committed by Rushabh Mehta
parent 4aff164b69
commit 55d91bbcf5

View file

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