def _create_sailthru_user_vars(user, profile):
 sailthru_vars = {'username': user.username, 'activated': int(user.is_active), 'joined_date': user.date_joined.strftime('%Y-%m-%d')}
 if profile:
  sailthru_vars['fullname'] = profile.name
  sailthru_vars['gender'] = profile.gender
  sailthru_vars['education'] = profile.level_of_education
  if profile.year_of_birth:
   sailthru_vars['year_of_birth'] = profile.year_of_birth
  sailthru_vars['country'] = unicode(profile.country.code)
 return sailthru_vars

def _create_sailthru_user_vars ( user , profile ) : sailthru_vars = { 'username' : user . username , 'activated' : int ( user . is_active ) , 'joined_date' : user . date_joined . strftime ( '%Y-%m-%d' ) } if profile : sailthru_vars [ 'fullname' ] = profile . name sailthru_vars [ 'gender' ] = profile . gender sailthru_vars [ 'education' ] = profile . level_of_education if profile . year_of_birth : sailthru_vars [ 'year_of_birth' ] = profile . year_of_birth sailthru_vars [ 'country' ] = unicode ( profile . country . code ) return sailthru_vars
create sailthru user create/update vars from user + profile .