Skip to content

Commit b110e3b

Browse files
author
derwentx
committed
better postmortem
1 parent 909e8ef commit b110e3b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

wordpress/api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ def request_post_mortem(self, response=None):
8989
headers = response.headers
9090

9191
requester_api_url = self.requester.api_url
92-
if hasattr(response, 'links'):
92+
if hasattr(response, 'links') and response.links:
9393
links = response.links
94-
if 'https://api.w.org/' in links:
95-
header_api_url = links['https://api.w.org/'].get('url', '')
94+
first_link_key = list(links)[0]
95+
header_api_url = links[first_link_key].get('url', '')
9696

9797
if header_api_url and requester_api_url\
9898
and header_api_url != requester_api_url:

0 commit comments

Comments
 (0)