'Converts empty string to None, to indicate not set. Replaced by to_representation in version 3.'

def transform_gender(self, user_profile, value):

    return AccountLegacyProfileSerializer.convert_empty_to_None(value)
