From dfcfa531e79b10ad9bb7fe1a0ed0a09490d08b4b Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Wed, 17 Jan 2024 19:53:57 +0530 Subject: [PATCH] fix: strip only if exist --- crm/fcrm/doctype/crm_deal/crm_deal.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crm/fcrm/doctype/crm_deal/crm_deal.py b/crm/fcrm/doctype/crm_deal/crm_deal.py index a69478a2..23208844 100644 --- a/crm/fcrm/doctype/crm_deal/crm_deal.py +++ b/crm/fcrm/doctype/crm_deal/crm_deal.py @@ -58,9 +58,9 @@ class CRMDeal(Document): for d in self.contacts: if d.is_primary == 1: primary_contact_exists = True - self.email = d.email.strip() - self.mobile_no = d.mobile_no.strip() - self.phone = d.phone.strip() + self.email = d.email.strip() if d.email else "" + self.mobile_no = d.mobile_no.strip() if d.mobile_no else "" + self.phone = d.phone.strip() if d.phone else "" break if not primary_contact_exists: