'Overwrite to_native to handle custom logic since we are serializing two models as one here
:param user: User object
:return: Dict serialized account'

def to_representation(self, user):

    try:
        user_profile = user.profile
    except ObjectDoesNotExist:
        user_profile = None
        LOGGER.warning('user    profile    for    the    user    [%s]    does    not    exist', user.username)
    accomplishments_shared = badges_enabled()
    data = {'username': user.username, 'url': self.context.get('request').build_absolute_uri(reverse('accounts_api', kwargs={'username': user.username})), 'email': user.email, 'date_joined': user.date_joined.replace(microsecond=0), 'is_active': user.is_active, 'bio': None, 'country': None, 'profile_image': None, 'language_proficiencies': None, 'name': None, 'gender': None, 'goals': None, 'year_of_birth': None, 'level_of_education': None, 'mailing_address': None, 'requires_parental_consent': None, 'accomplishments_shared': accomplishments_shared, 'account_privacy': self.configuration.get('default_visibility')}
    if user_profile:
        data.update({'bio': AccountLegacyProfileSerializer.convert_empty_to_None(user_profile.bio), 'country': AccountLegacyProfileSerializer.convert_empty_to_None(user_profile.country.code), 'profile_image': AccountLegacyProfileSerializer.get_profile_image(user_profile, user, self.context.get('request')), 'language_proficiencies': LanguageProficiencySerializer(user_profile.language_proficiencies.all(), many=True).data, 'name': user_profile.name, 'gender': AccountLegacyProfileSerializer.convert_empty_to_None(user_profile.gender), 'goals': user_profile.goals, 'year_of_birth': user_profile.year_of_birth, 'level_of_education': AccountLegacyProfileSerializer.convert_empty_to_None(user_profile.level_of_education), 'mailing_address': user_profile.mailing_address, 'requires_parental_consent': user_profile.requires_parental_consent(), 'account_privacy': get_profile_visibility(user_profile, user, self.configuration)})
    if self.custom_fields:
        fields = self.custom_fields
    elif user_profile:
        fields = _visible_fields(user_profile, user, self.configuration)
    else:
        fields = self.configuration.get('public_fields')
    return self._filter_fields(fields, data)
