Repository navigation
[Confluence] ConfluenceCloud: add remove_page_from_trash and remove_page_as_draft - #1707
Merged
gonchik merged 1 commit intoOct 27, 2026
Conversation
…age_as_draft
docs/confluence.rst documents remove_page_from_trash(page_id) and
remove_page_as_draft(page_id), and the Server client has both, but the
Cloud client does not, so Confluence(url="https://<site>.atlassian.net")
and ConfluenceCloud raise "'Cloud' object has no attribute
'remove_page_from_trash'".
Add both to Cloud with the same behaviour as the Server client: they call
remove_page with status="trashed" and status="draft", which sends DELETE
to /wiki/rest/api/content/{id} with that status.
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.remove_page_from_trash(page_id)andconfluence.remove_page_as_draft(page_id), and the Server client has both. The Cloud client (Confluence(url="https://<site>.atlassian.net")/ConfluenceCloud) doesn't, so they fail with:Now that
Cloudhasremove_page()(#1705), this adds both helpers toCloudwith the same behaviour as the Server client:remove_page_from_trash()callsremove_page(page_id, status="trashed"), which sendsDELETE /wiki/rest/api/content/{id}?status=trashedto purge a trashed page;remove_page_as_draft()callsremove_page(page_id, status="draft");remove_page()returns (normally204, or the raw response withadvanced_mode=True) and raise the same errors.I also added a line to the
remove_page_from_trashentry indocs/confluence.rstsaying both work on Cloud.Tests: added three tests to
tests/confluence/test_confluence_cloud.py(each method onConfluenceCloud, and both throughConfluence(url="https://test.atlassian.net")); they fail on master with the error above. The full pytest suite,tox -e mypy, bandit and doc8 pass, and black and flake8 are clean on the changed files. I haven't run it against a real Confluence Cloud site.