def METHOD_NAME(self, instance):
    if not instance.allow_delete():
        raise PermissionDenied('You cannot delete this discount because it already has '
                               'been used as part of an order.')
    instance.log_action(
        'pretix.event.discount.deleted',
        user=self.request.user,
        auth=self.request.auth,
    )
    CartPosition.objects.filter(discount=instance).update(discount=None)
    super().METHOD_NAME(instance)