Skip to content

Commit d60f1f4

Browse files
djachkovgonchik
authored andcommitted
Confluence: minor change in get_page_by_title log output (#401)
* Bitbucket: add branch-permissions methods, add some docs, add examples * Confluence: improve get_page_by_title log output
1 parent 10f3759 commit d60f1f4

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

atlassian/confluence.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,15 @@ def get_page_by_title(self, space, title, start=0, limit=1, expand=None):
144144
params['spaceKey'] = str(space)
145145
if title is not None:
146146
params['title'] = str(title)
147-
try:
148-
return (self.get(url, params=params) or {}).get('results')[0]
149-
except IndexError as e:
150-
log.error(e)
151-
return None
147+
if self.advanced_mode:
148+
return self.get(url, params=params)
149+
else:
150+
try:
151+
return (self.get(url, params=params) or {}).get('results')[0]
152+
except IndexError as e:
153+
log.error("Can't find {title} page on the {url}!".format(title=title, url=self.url))
154+
log.debug(e)
155+
return None
152156

153157
def get_page_by_id(self, page_id, expand=None):
154158
"""

0 commit comments

Comments
 (0)