Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add domain to Hubspot company #3648

Merged
merged 10 commits into from
Mar 27, 2024
Merged

Conversation

zachaysan
Copy link
Contributor

Thanks for submitting a PR! Please check the boxes below:

  • I have run pre-commit to check linting
  • I have added information to docs/ if required so people know about the feature!
  • I have filled in the "Changes" section below?
  • I have filled in the "How did you test this code" section below?
  • I have used a Conventional Commit title for this Pull Request

Changes

Fixes #3626

Simple change to introduce adding domain to the Hubspot company model.

How did you test this code?

Since this change was purely against their API, I elected to just test it manually which was successful.

@zachaysan zachaysan requested a review from novakzaballa March 21, 2024 18:40
Copy link

vercel bot commented Mar 21, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 27, 2024 5:32pm
flagsmith-frontend-preview ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 27, 2024 5:32pm
flagsmith-frontend-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 27, 2024 5:32pm

Comment on lines 61 to 74
def get_or_create_organisation_hubspot_id(
self, organisation: Organisation, user: FFAdminUser
) -> str:
"""
Return the Hubspot API's id for an organisation.
"""
if getattr(organisation, "hubspot_organisation", None):
return organisation.hubspot_organisation.hubspot_id

response = self.client.create_company(name=organisation.name)
if user.email_domain in settings.HUBSPOT_IGNORE_ORGANISATION_DOMAINS:
domain = None
else:
domain = user.email_domain
response = self.client.create_company(name=organisation.name, domain=domain)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should update the unit tests for this logic.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok altered one existing test to capture when it is set and created a new test for when the domain name is in the filter list.

@codecov-commenter
Copy link

codecov-commenter commented Mar 25, 2024

Codecov Report

Attention: Patch coverage is 92.85714% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 95.87%. Comparing base (361657b) to head (210e2ed).
Report is 15 commits behind head on main.

Files Patch % Lines
api/integrations/lead_tracking/hubspot/client.py 33.33% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3648   +/-   ##
=======================================
  Coverage   95.87%   95.87%           
=======================================
  Files        1099     1099           
  Lines       34457    34490   +33     
=======================================
+ Hits        33034    33066   +32     
- Misses       1423     1424    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

github-actions bot commented Mar 27, 2024

Uffizzi Preview deployment-49039 was deleted.

@zachaysan zachaysan added this pull request to the merge queue Mar 27, 2024
Merged via the queue into main with commit 87d2d52 Mar 27, 2024
23 checks passed
@zachaysan zachaysan deleted the feat/add_domain_to_hubspot_company branch March 27, 2024 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issue related to the REST API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hubspot: send domain name with Company to Hubspot
4 participants