mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
don't include sharepoint link when triggering pashub fetcher from hubspot etl
This commit is contained in:
parent
d31d0683f5
commit
2d9aa51929
1 changed files with 12 additions and 7 deletions
|
|
@ -67,7 +67,9 @@ def handler(body: dict[str, Any], context: Any) -> None:
|
|||
logger.info(
|
||||
f"Triggering MagicPlan fetcher for HubSpot deal ID {hubspot_deal_id}"
|
||||
)
|
||||
_trigger_magicplan_fetcher(sqs_client, hubspot_deal, listing, hubspot_deal_id)
|
||||
_trigger_magicplan_fetcher(
|
||||
sqs_client, hubspot_deal, listing, hubspot_deal_id
|
||||
)
|
||||
else:
|
||||
# Deal already in db, check whether anything has changed
|
||||
logger.info(
|
||||
|
|
@ -119,13 +121,18 @@ def handler(body: dict[str, Any], context: Any) -> None:
|
|||
logger.info(
|
||||
f"Triggering MagicPlan fetcher for HubSpot deal ID {hubspot_deal_id}"
|
||||
)
|
||||
_trigger_magicplan_fetcher(sqs_client, hubspot_deal, listing, hubspot_deal_id)
|
||||
_trigger_magicplan_fetcher(
|
||||
sqs_client, hubspot_deal, listing, hubspot_deal_id
|
||||
)
|
||||
|
||||
print("done")
|
||||
|
||||
|
||||
def _trigger_magicplan_fetcher(
|
||||
sqs_client: Any, hubspot_deal: Dict[str, str], listing: Optional[dict[str, str]], hubspot_deal_id: str
|
||||
sqs_client: Any,
|
||||
hubspot_deal: Dict[str, str],
|
||||
listing: Optional[dict[str, str]],
|
||||
hubspot_deal_id: str,
|
||||
) -> None:
|
||||
message_body = {
|
||||
"address": hubspot_deal.get("dealname"),
|
||||
|
|
@ -136,9 +143,7 @@ def _trigger_magicplan_fetcher(
|
|||
QueueUrl=get_settings().MAGICPLAN_SQS_URL,
|
||||
MessageBody=json.dumps(message_body),
|
||||
)
|
||||
logger.info(
|
||||
f"Sent message to MagicPlan queue. MessageId: {response['MessageId']}"
|
||||
)
|
||||
logger.info(f"Sent message to MagicPlan queue. MessageId: {response['MessageId']}")
|
||||
|
||||
|
||||
def _trigger_pashub_fetcher(
|
||||
|
|
@ -148,7 +153,7 @@ def _trigger_pashub_fetcher(
|
|||
"pashub_link": hubspot_deal["pashub_link"],
|
||||
"address": None, # potentially available from Listing, leave as None for now
|
||||
"hubspot_deal_id": deal_id,
|
||||
"sharepoint_link": hubspot_deal.get("sharepoint_link", None),
|
||||
# "sharepoint_link": hubspot_deal.get("sharepoint_link", None), # Don't send sharepoint link for now as they are inconsistent
|
||||
"uprn": hubspot_deal.get("national_uprn", None),
|
||||
"landlord_property_id": hubspot_deal.get("owner_property_id", None),
|
||||
"deal_stage": hubspot_deal.get("deal_stage", None),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue