def METHOD_NAME(self, request, *args, **kwargs):
    # pylint: disable=attribute-defined-outside-init
    self.product = get_object_or_404(
        self.product_model, pk=kwargs["product_pk"], is_public=True
    )
    # check permission to leave review
    if not self.product.is_review_permitted(request.user):
        if self.product.has_review_by(request.user):
            message = _("You have already reviewed this product!")
        else:
            message = _("You can't leave a review for this product.")
        messages.warning(self.request, message)
        return redirect(self.product.get_absolute_url())
    return super().METHOD_NAME(request, *args, **kwargs)