From 4e2d0171101949daaf19cbb392ac4e248b93f3d4 Mon Sep 17 00:00:00 2001 From: andreas-j-hauser Date: Tue, 23 Jul 2019 08:59:03 +0200 Subject: [PATCH 1/2] issue #286: remove useless parameter start and limit and add expand to function Confluence.get_page_by_title --- atlassian/confluence.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/atlassian/confluence.py b/atlassian/confluence.py index 990ce39c6..dce19f68f 100644 --- a/atlassian/confluence.py +++ b/atlassian/confluence.py @@ -92,24 +92,22 @@ def get_page_space(self, page_id): """ return ((self.get_page_by_id(page_id, expand='space') or {}).get('space') or {}).get('key') - def get_page_by_title(self, space, title, start=None, limit=None): + def get_page_by_title(self, space, title, expand=None): """ Returns the list of labels on a piece of Content. :param space: Space key :param title: Title of the page - :param start: OPTIONAL: The start point of the collection to return. Default: None (0). - :param limit: OPTIONAL: The limit of the number of labels to return, this may be restricted by - fixed system limits. Default: 200. + :param expand: OPTIONAL: expand e.g. history :return: The JSON data returned from searched results the content endpoint, or the results of the callback. Will raise requests.HTTPError on bad input, potentially. If it has IndexError then return the None. """ url = 'rest/api/content' params = {} - if start is not None: - params['start'] = int(start) - if limit is not None: - params['limit'] = int(limit) + params['start'] = 0 + params['limit'] = 1 + if expand is not None: + params['expand'] = expand if space is not None: params['spaceKey'] = str(space) if space is not None: From 96371a60e7a4fc62a898c3a13270f9d7d4eb1c35 Mon Sep 17 00:00:00 2001 From: andreas-j-hauser Date: Tue, 23 Jul 2019 09:30:05 +0200 Subject: [PATCH 2/2] issue #286: fix a code inspector warning --- atlassian/confluence.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/atlassian/confluence.py b/atlassian/confluence.py index dce19f68f..cd5bc7cd3 100644 --- a/atlassian/confluence.py +++ b/atlassian/confluence.py @@ -103,9 +103,10 @@ def get_page_by_title(self, space, title, expand=None): If it has IndexError then return the None. """ url = 'rest/api/content' - params = {} - params['start'] = 0 - params['limit'] = 1 + params = { + 'start': '0', + 'limit': '1' + } if expand is not None: params['expand'] = expand if space is not None: