Skip to content

Commit 6d9c884

Browse files
authored
Add the type parameters whether a page exists (#1091)
Add the type parameters when judging whether a page exists, such as blogpost, page
1 parent dc71bd2 commit 6d9c884

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

atlassian/confluence.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,12 @@ def _get_paged(
106106

107107
return
108108

109-
def page_exists(self, space, title):
109+
def page_exists(self, space, title, type=None):
110110
"""
111111
Check if title exists as page.
112112
:param space: Space key
113113
:param title: Title of the page
114+
:param type: type of the page, 'page' or 'blogpost'. Defaults to 'page'
114115
:return:
115116
"""
116117
url = "rest/api/content"
@@ -119,6 +120,8 @@ def page_exists(self, space, title):
119120
params["spaceKey"] = str(space)
120121
if title is not None:
121122
params["title"] = str(title)
123+
if type is not None:
124+
params["type"] = str(type)
122125

123126
try:
124127
response = self.get(url, params=params)

0 commit comments

Comments
 (0)