[Answer]-How to use post_publish signal to publish a related page referenced by show_placeholder?

1👍

You actually want to connect a signal to CMSPlugin, not Page.

Something like this (untested!) might work:

def signal_handler(instance, **kwargs):
    if not isinstance(instance, CMSPlugin):
        return
    page = Page.objects.get(reverse_id='extra-placeholders', publisher_is_draft = True)
    if page.placeholders.filter(pk=instance.placeholder_id).exists():
        page.publish()

post_save.connect(signal_handler)
👤ojii

Leave a comment