Skip to content

Commit 78b39b4

Browse files
andreas-j-hausergonchik
authored andcommitted
Issue 286: Confluence.get_page_by_title() works like Confluence.get_page_by_id() (#288)
* issue #286: remove useless parameter start and limit and add expand to function Confluence.get_page_by_title * issue #286: fix a code inspector warning
1 parent 95c4274 commit 78b39b4

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

atlassian/confluence.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -104,24 +104,23 @@ def get_page_space(self, page_id):
104104
"""
105105
return ((self.get_page_by_id(page_id, expand='space') or {}).get('space') or {}).get('key')
106106

107-
def get_page_by_title(self, space, title, start=None, limit=None):
107+
def get_page_by_title(self, space, title, expand=None):
108108
"""
109109
Returns the list of labels on a piece of Content.
110110
:param space: Space key
111111
:param title: Title of the page
112-
:param start: OPTIONAL: The start point of the collection to return. Default: None (0).
113-
:param limit: OPTIONAL: The limit of the number of labels to return, this may be restricted by
114-
fixed system limits. Default: 200.
112+
:param expand: OPTIONAL: expand e.g. history
115113
:return: The JSON data returned from searched results the content endpoint, or the results of the
116114
callback. Will raise requests.HTTPError on bad input, potentially.
117115
If it has IndexError then return the None.
118116
"""
119117
url = 'rest/api/content'
120-
params = {}
121-
if start is not None:
122-
params['start'] = int(start)
123-
if limit is not None:
124-
params['limit'] = int(limit)
118+
params = {
119+
'start': '0',
120+
'limit': '1'
121+
}
122+
if expand is not None:
123+
params['expand'] = expand
125124
if space is not None:
126125
params['spaceKey'] = str(space)
127126
if title is not None:

0 commit comments

Comments
 (0)