def METHOD_NAME(self, view) -> Project:
    try:
        project_pk = view.kwargs[self._view_kwarg_name]
        return Project.objects.get(id=project_pk)
    except KeyError:
        raise APIException(
            "`IsProjectAdmin` incorrectly configured. No project pk found."
        )
    except Project.DoesNotExist:
        raise PermissionDenied()