-
Notifications
You must be signed in to change notification settings - Fork 2
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
Jk/hubspot sync #291
Jk/hubspot sync #291
Conversation
Codecov Report
@@ Coverage Diff @@
## master #291 +/- ##
==========================================
- Coverage 94.42% 94.35% -0.07%
==========================================
Files 159 161 +2
Lines 5343 5388 +45
Branches 311 319 +8
==========================================
+ Hits 5045 5084 +39
- Misses 242 245 +3
- Partials 56 59 +3
Continue to review full report at Codecov.
|
d50c1d7
to
d59ab9e
Compare
@jklingen92 you should find a way to embed the gif , not just a link - too much work ! |
users/tasks.py
Outdated
"value": mapping["default"] if "default" in mapping else "", | ||
} | ||
if mapping["model"] == "profile" and hasattr(user, "profile"): | ||
prop["value"] = getattr(user.profile, mapping["field"]) |
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.
This line doesn't seem to be covered by unit tests, can you add one? Probably need to create & use a ProfileFactory
class and include it as part of UserFactory
:
profile = RelatedFactory("users.factories.Profile", "user")
Not sure if it's relevant or not, but it seems like Hubspot contacts can have state/region and country fields, those would need to be obtained from the LegalAddress
model if they need to be synced with Hubspot too.
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.
@mbertrand This is what I was asking about regarding the Profile Model. Should that be added as a part of this PR?
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.
Yes if you need any of the fields stored in Profile
to also be saved in Hubspot contacts, which seems likely. Ditto for LegalAddress
. @pdpinch or @Ferdi which fields should be synced? Issue #275 doesn't explicitly specify any as far as I can see, but edx syncs the following: first name, last name, company, job title, state, country, gender, degree.
Any update on these?:
|
8d820bd
to
75fa03b
Compare
@Ferdi @pdpinch I'm planning on imitating the Profile model and extending the profile save function. |
@jklingen92 should this PR be closed? |
This PR is waiting on 3 things:
Pre-Flight checklist
app.json
What are the relevant tickets?
#275
#236
What's this PR do?
Add celery tasks to sync contacts with hubspot.
How should this be manually tested?
You could run it in ipython, make a change to a user, and then run the task manually as opposed to through celery. Then check that the update was made on Hubspot.
Where should the reviewer start?
users/tasks
Any background context you want to provide?
(Optional)
Screenshots (if appropriate)
(Optional)
What GIF best describes this PR or how it makes you feel?