code: def cleanup_on_delete(self, sender, document, **kwargs):
          '''
          Clean up slug redirections on object deletion
          '''
          if not self.follow or sender is not self.owner_document:
              return
          slug = getattr(document, self.db_field)
          namespace = self.owner_document.__name__
          SlugFollow.objects(namespace=namespace, new_slug=slug).delete(f cleanup_on_delete(self, sender, document, **kwargs):
          '''
          Clean up slug redirections on object deletion
          '''
          if not self.follow or sender is not self.owner_document:
              return
          slug = getattr(document, self.db_field)
          namespace = self.owner_document.__name__
          SlugFollow.objects(namespace=namespace, new_slug=slug).delete()
docs: Clean up slug redirections on object deletion