1
0
forked from test/crm

fix: strip only if exist

This commit is contained in:
Shariq Ansari 2024-01-17 19:53:57 +05:30
parent f3ebc4b853
commit dfcfa531e7

View File

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