Repository navigation
[Confluence] ConfluenceCloud.page_exists: check blog posts when type="blogpost" - #1703
Merged
gonchik merged 1 commit intoOct 25, 2026
Conversation
…"blogpost" The docs say page_exists() takes type="page" or "blogpost", but the Cloud client passed type through **kwargs as an extra query parameter on api/v2/pages, so page_exists(space, title, type="blogpost") only ever looked at pages and returned False for an existing blog post. Take type as an explicit argument and query api/v2/blogposts with the same space-id/title/status filters when it is "blogpost". type is no longer sent to the V2 pages endpoint.
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.
docs/confluence.rstdocumentsconfluence.page_exists(space, title, type=None)with type'page'or'blogpost', and the Server client handles both. The Cloud client (Confluence(url="https://<site>.atlassian.net")/ConfluenceCloud) has notypeargument, so it ends up in**kwargsand is sent as an extra query parameter toapi/v2/pages. That meansonly ever searches pages and returns
Falsefor an existing blog post (orTrueif a page happens to have the same title).page_exists()now takestypeexplicitly. Withtype="blogpost"it queriesGET /wiki/api/v2/blogposts, which takes the samespace-id,titleandstatusfilters as/pages, after the same space key lookup. Any other value still goes toapi/v2/pages, andtypeis no longer forwarded as a query parameter. This is the same split asConfluenceV2.get_page_id()from #1702.Tests: added
test_page_exists_uses_v2_blogpost_endpoint_for_blogpost_typeandtest_page_exists_does_not_send_page_type_to_v2totests/confluence/test_confluence_cloud.py; both fail on master. The full pytest suite andtox -e mypypass, and black and flake8 are clean on the changed files. I haven't run it against a real Confluence Cloud site.