Skip to content

Commit

Permalink
Update token.py
Browse files Browse the repository at this point in the history
Changes needed to support requests version 2.25.1 or higher. If I got it right, this is necessary as a result of the changes in version 2.24.0. See psf/requests#5500 for details.
  • Loading branch information
wp99cp authored Mar 26, 2021
1 parent 7baa3eb commit 974ff01
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions postcard_creator/token.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ def _get_access_token_swissid(self, session, username, password):
if len(resp.history) == 0:
raise PostcardCreatorException('fail to fetch ' + url)

step1_goto_url = resp.history[len(resp.history) - 1]
goto_param = re.search(r'goto=(.*?)$', step1_goto_url.url).group(1)
step1_goto_url = resp.history[len(resp.history) - 1].headers['Location']
goto_param = re.search(r'goto=(.*?)$', step1_goto_url).group(1)
try:
goto_param = goto_param.split('&')[0]
except Exception as e:
Expand Down

0 comments on commit 974ff01

Please sign in to comment.