def METHOD_NAME(self, request, pk):
    try:
        UUID(pk, version=4)
        return super().METHOD_NAME(self, request, pk)
    except ValueError:
        queryset = UserProfileFullSerializer.setup_eager_loading(UserProfile.objects)
        profile = get_object_or_404(queryset, ldap_id=pk)
        return Response(UserProfileFullSerializer(
            profile, context={'request': request}).data)