Report the user's name and company to Marketo

Also fixes the API to report the other changes (username and email) as well
This commit is contained in:
Joseph Schorr 2016-11-09 15:29:53 -05:00
parent 860942ece1
commit 1a61ef4e04
8 changed files with 78 additions and 24 deletions

View file

@ -355,10 +355,11 @@ def list_entity_robot_permission_teams(entity_name, include_permissions=False):
return TupleSelector(query, fields)
def update_user_metadata(user, name=None, company=None):
def update_user_metadata(user, given_name=None, family_name=None, company=None):
""" Updates the metadata associated with the user, including his/her name and company. """
with db_transaction():
user.name = name or user.name
user.given_name = given_name or user.given_name
user.family_name = family_name or user.family_name
user.company = company or user.company
user.save()