def METHOD_NAME(self):
    if not self.success_url_name:
        raise ImproperlyConfigured(
            "Subclasses of wagtail.admin.views.generic.base.BaseOperationView must provide a "
            "success_url_name attribute or a get_success_url method"
        )
    if self.next_url:
        return self.next_url
    return reverse(self.success_url_name, args=[quote(self.object.pk)])