Sometimes methond confluence.remove_page() with parameter recursive=True can't delete all child pages.
Instead it will delete only fixed number of child pages and delete a root page. All remaining child pages will be moved to the root of the space.
This is possible because inside confluence.remove_page() we use confluence.get_page_child_by_type()
|
def get_page_child_by_type(self, page_id, type="page", start=None, limit=None, expand=None): |
|
""" |
|
Provide content by type (page, blog, comment) |
|
:param page_id: A string containing the id of the type content container. |
|
:param type: |
|
:param start: OPTIONAL: The start point of the collection to return. Default: None (0). |
|
:param limit: OPTIONAL: how many items should be returned after the start index. Default: Site limit 200. |
|
:param expand: OPTIONAL: expand e.g. history |
|
:return: |
|
""" |
By default
limit=None, but In my case it was
25 by default. This led to an incorrect amount of executions here:
|
if recursive: |
|
children_pages = self.get_page_child_by_type(page_id) |
|
for children_page in children_pages: |
|
self.remove_page(children_page.get("id"), status, recursive) |
At the moment, I still have not trace what forces
limit to take default value
25. Maybe this is a bug.
Sometimes methond
confluence.remove_page()with parameterrecursive=Truecan't delete all child pages.Instead it will delete only fixed number of child pages and delete a root page. All remaining child pages will be moved to the root of the space.
This is possible because inside
confluence.remove_page()we useconfluence.get_page_child_by_type()atlassian-python-api/atlassian/confluence.py
Lines 60 to 69 in 523057c
By default
limit=None, but In my case it was25by default. This led to an incorrect amount of executions here:atlassian-python-api/atlassian/confluence.py
Lines 579 to 582 in 523057c
At the moment, I still have not trace what forces
limitto take default value25. Maybe this is a bug.