chore: Se extrae lógica de buscar movil de prospecto en un método aparte
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
9928194cf7
commit
e72de25e3a
@ -43,12 +43,7 @@ class ProspectTrace(ModelSQL, ModelView):
|
|||||||
if self.prospect:
|
if self.prospect:
|
||||||
self.prospect_city = self.prospect.city
|
self.prospect_city = self.prospect.city
|
||||||
|
|
||||||
mobile_contact = None
|
mobile_contact = self._get_prospect_mobile_contact()
|
||||||
for contact_method in self.prospect.contact_methods:
|
|
||||||
if contact_method.contact_type == 'mobile':
|
|
||||||
mobile_contact = contact_method
|
|
||||||
break
|
|
||||||
|
|
||||||
if mobile_contact:
|
if mobile_contact:
|
||||||
self.prospect_contact = mobile_contact
|
self.prospect_contact = mobile_contact
|
||||||
|
|
||||||
@ -67,3 +62,8 @@ class ProspectTrace(ModelSQL, ModelView):
|
|||||||
def _get_current_interest(self, name):
|
def _get_current_interest(self, name):
|
||||||
if self.calls:
|
if self.calls:
|
||||||
return self.calls[-1].interest
|
return self.calls[-1].interest
|
||||||
|
|
||||||
|
def _get_prospect_mobile_contact(self):
|
||||||
|
for contact_method in self.prospect.contact_methods:
|
||||||
|
if contact_method.contact_type == 'mobile':
|
||||||
|
return contact_method
|
||||||
|
Loading…
Reference in New Issue
Block a user