title: Wagtail: delete() method not called in Page instance
body: <p>I want to automatically create a <code>Collection</code> when a Page instance is saved and link it to the page using a FK, and it needs to be deleted if the page instance is deleted.</p>
  <pre class="lang-py prettyprint-override"><code>class CustomProject(BasePage):
      description = models.TextField(_(&quot;description&quot;), default=&quot;&quot;, blank=True)
      main_section_image = models.ForeignKey(
          &quot;wagtailimages.Image&quot;,
          verbose_name=_(&quot;Main section image&quot;),
          on_delete=models.PROTECT,
          related_name=&quot;+&quot;,
      )
      images_collection = models.ForeignKey(
          Collection,
          on_delete=models.PROTECT,
          null=True,
          blank=True,
          editable=False,
      )
  
      content_panels = BasePage.content_panels + [
          FieldPanel(&quot;description&quot;, classname=&quot;full&quot;),
          FieldPanel(&quot;main_section_image&quot;),
          HelpPanel(_(
              &quot;To manage the project's photos, firstly save this page's changes &quot;
              &quot;(either as Draft or Published) and then go to the &quot;
              &quot;&lt;a href=\&quot;/cms/images\&quot;&gt;%(url_label)s&lt;/a&gt;, &quot;
              &quot;select the collection with the same namne as this project and &quot;
              &quot;there add the images.&quot;
          ) % {&quot;url_label&quot;: &quot;Images section&quot;}),
      ]
  
      parent_page_types = [&quot;cms_site.CustomProjectsPage&quot;]
      page_description = _(&quot;Custom project page.&quot;)
      template = &quot;pages/custom_projects/custom_project.html&quot;
  
      def save(self, clean=True, user=None, log_action=False, **kwargs):
          self.create_or_update_collection()
          return super().save(clean, user, log_action, **kwargs)
  
      def delete(self, *args, **kwargs):
          print(&quot;calling delete&quot;)
          self.delete_collection()
          super().delete(self, *args, **kwargs)
  
      def create_or_update_collection(self):
          collection_name = f&quot;[Projecte a mida] {self.title}&quot;
          if not self.images_collection:
              root_node = Collection.objects.get(id=get_root_collection_id())
              new_collection = root_node.add_child(name=collection_name)
              self.images_collection = new_collection
          else:
              self.images_collection.name = collection_name
              self.images_collection.save()
  
      def delete_collection(self):
          if self.images_collection:
              Collection.objects.get(id=self.images_collection.id).delete()
  </code></pre>
  <p>The <code>delete()</code> method is not called at all, neither deleting a Draft or a Published instance.
  The <code>save()</code> is working perfectly fine in both cases.</p>
  <p>Is that the expected behavior for some reason?
  Should I rely only in something like signals or hooks for this purpose? (I imagine that's the answer, but I still don't get why the <code>save</code> is called and the <code>delete</code> is not)</p>
  <p><code>BassePage</code> is not messing with it, I don't think it's relevant but i paste it here to share the full code:</p>
  <pre class="lang-py prettyprint-override"><code>class BasePage(Page):
      header_image = models.ForeignKey(
          &quot;wagtailimages.Image&quot;,
          verbose_name=_(&quot;Header image&quot;),
          on_delete=models.PROTECT,
          related_name=&quot;+&quot;,
          null=True,
          blank=False,
      )
  
      content_panels = Page.content_panels + [
          FieldPanel(&quot;header_image&quot;),
      ]
      show_in_menus_default = False
  
      class Meta:
          abstract = True
  </code></pre>
  <p>Thanks a lot!</p>
  <p>Edit: in case someone wants an example on how to implement it using hooks, is really simple and <a href="https://docs.wagtail.org/en/v4.0.1/reference/hooks.html" rel="nofollow noreferrer">well documented</a>.</p>
  <p>Just create a <code>wagtail_hooks.py</code> file at the root of your app with:</p>
  <pre class="lang-py prettyprint-override"><code>from wagtail import hooks
  from wagtail.models import Collection
  
  from apps.cms_site.models import CustomProject
  
  
  @hooks.register(&quot;after_delete_page&quot;)
  def after_delete_custom_project(request, page):
      if (
          request.method == 'POST'
          and page.specific_class is CustomProject
          and page.images_collection
      ):
          Collection.objects.get(id=page.images_collection.id).delete()
  </code></pre>