Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Request]: pre_page_publish #11812

Open
m10rten opened this issue Apr 2, 2024 · 0 comments
Open

[Request]: pre_page_publish #11812

m10rten opened this issue Apr 2, 2024 · 0 comments

Comments

@m10rten
Copy link

m10rten commented Apr 2, 2024

Is your proposal related to a problem?

Not directly, the suggestion/feature request comes from the fact that I have the following challenge: I want to check if a serializer has the page that I just updated in the admin, problem is, it might or might not disapear from the resultset when serializing in the (post_)page_published signal.

Describe the solution you'd like

Same as page_published.connect

A pre_page_publish or pre_page_published with access or possibility to access the database object(s) before the save happens.

Describe alternatives you've considered

I have tried working with the Django Signals but as a non-django non-wagtail user and developer, it is just so much harder then using wagtail.signals.page_published.

Additional context

I searched the issues and it seems I am the first to notice that this is not here (maybe for a reason I do not know).

Working on this

I can contribute where possible, It does not seem so difficult to add a _before_publish the same way there is a _after_publish, it is just hard to say what should be passed in this callback, if even at all, and should you change anything before or after it, or again: not even at all.

Anyone can contribute to this. View our contributing guidelines, add a comment to the issue once you’re ready to start.

Edit:
I now see that there is a before_page_publish but I am not sure if that can do what I need it to do: pass data to the post (eg: changed=True): https://docs.wagtail.org/en/stable/reference/hooks.html#before-publish-page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant