Skip to content

Commit

Permalink
update full name on user profile (#1825)
Browse files Browse the repository at this point in the history
* allow full name editable on user profile

* update sync_contact_with_hubspot to specify update fields
  • Loading branch information
rachellougee committed Aug 22, 2023
1 parent 34ca74b commit 67506b2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion hubspot_sync/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ def sync_contact_with_hubspot(user: User):
body=body,
)
user.hubspot_sync_datetime = now_in_utc()
user.save()
user.save(update_fields=["hubspot_sync_datetime"])

return result

Expand Down
1 change: 0 additions & 1 deletion users/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,6 @@ def update(self, instance, validated_data):

user = super().update(instance, validated_data)

sync_hubspot_user(user)
return user

class Meta:
Expand Down
2 changes: 2 additions & 0 deletions users/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from rest_framework.permissions import IsAdminUser, IsAuthenticated
from rest_framework.response import Response

from hubspot_sync.task_helpers import sync_hubspot_user
from main.permissions import UserIsOwnerPermission
from main.views import RefinePagination
from openedx import tasks
Expand Down Expand Up @@ -54,6 +55,7 @@ def update(self, request, *args, **kwargs):
if user_name != request.data.get("name"):
tasks.change_edx_user_name_async.delay(request.user.id)
tasks.update_edx_user_profile(request.user.id)
sync_hubspot_user(request.user)
return update_result


Expand Down

0 comments on commit 67506b2

Please sign in to comment.