def dispatch(self, request, *args, **kwargs):
        if 'product_pk' in kwargs:
            try:
                self.product = Product.objects.get(pk=kwargs['product_pk'])
            except __HOLE__:
                messages.error(
                    request, _("The requested product no longer exists"))
                return redirect('wishlists-create')
        return super(WishListCreateView, self).dispatch(
            request, *args, **kwargs)
dataset/ETHPy150Open django-oscar/django-oscar/src/oscar/apps/customer/wishlists/views.py/WishListCreateView.dispatch