-
Notifications
You must be signed in to change notification settings - Fork 429
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 ReportAttention: Patch coverage is
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. |
Uffizzi Preview |
Thanks for submitting a PR! Please check the boxes below:
pre-commit
to check lintingdocs/
if required so people know about the feature!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.