Skip to content

Commit

Permalink
register hook in base class
Browse files Browse the repository at this point in the history
  • Loading branch information
gmishkin committed Jan 10, 2025
1 parent 3704aa5 commit 58cd331
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions jira/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,10 @@ def cookies(self):
) # handle_401 should've caught this before attempting retry
return self._session.cookies

def __call__(self, request: requests.PreparedRequest):
request.register_hook("response", self.handle_401)
return request

def _increment_401_retry_counter(self):
self._retry_counter_401 += 1

Expand Down Expand Up @@ -392,10 +396,6 @@ def __init__(
self._session_api_url = session_api_url # e.g ."/rest/auth/1/session"
self.__auth = auth

def __call__(self, request: requests.PreparedRequest):
request.register_hook("response", self.handle_401)
return request

def init_session(self):
"""Initialise the Session object's cookies, so we can use the session cookie.
Expand Down

0 comments on commit 58cd331

Please sign in to comment.