Skip to content

Commit

Permalink
fix: remove special characters from contact before saving
Browse files Browse the repository at this point in the history
  • Loading branch information
Rohan Bansal committed Jul 22, 2022
1 parent 53ac21b commit 6812602
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions shipstation_integration/customer.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ def create_contact(order: "ShipStationOrder", customer_name: str):
return frappe._dict({"name": contact})
cont: "Contact" = frappe.new_doc("Contact")
cont.first_name = order.bill_to.name or "Not Provided"
for char in "<>":
cont.first_name = cont.first_name.replace(char, "")
if customer_name:
cont.append("email_ids", {"email_id": customer_name})
cont.append("links", {"link_doctype": "Customer", "link_name": customer_name})
Expand Down

0 comments on commit 6812602

Please sign in to comment.