Make post topic page child creation safer#456
Closed
RealOrangeOne wants to merge 2 commits intomainfrom
Closed
Conversation
This lets the signals be sent when running non-wagtail admin codepaths.
MebinAbraham
reviewed
Jan 7, 2026
Comment on lines
+62
to
+64
| # If the page already exists, do nothing | ||
| if ArticlesIndexPage.objects.child_of(instance).exists(): | ||
| return |
Contributor
There was a problem hiding this comment.
Could you include a scenario where this is true? If it was just created, how can it already exist? Is it meant to cover edge cases like multiple requests at the same time, or if the transaction rolled back? (I suspect the signal is independent of the transcation?) It is worth expanding the comment to avoid questions in the future about what this is intended to protect against.
Contributor
Author
|
On reflection, I think this might in fact be a problem with the deletion script in #445. It deletes the parent pages whilst leaving their child pages in tact. I'll do some more digging, but it's likely this can be closed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the context of this PR?
Sometimes, the child pages already exist (for a variety of reasons). This modifies the hook to only create the page if one doesn't already exist.
How to review
Note that this is built on #455, so best review once that has merged.
Follow-up Actions