Skip to content

Commit cf9354b

Browse files
committed
Changes in line with comments on PR
1 parent e5133ac commit cf9354b

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

O365/connection.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -970,14 +970,17 @@ def _check_delay(self) -> None:
970970
self._previous_request_at = time.time()
971971

972972
def _internal_request(
973-
self, session_obj: Session, url: str, method: str, ignore401: bool, **kwargs
973+
self, session_obj: Session, url: str, method: str, ignore401: bool = False, **kwargs
974974
) -> Response:
975975
"""Internal handling of requests. Handles Exceptions.
976976
977977
:param session_obj: a requests Session instance.
978978
:param str url: url to send request to
979979
:param str method: type of request (get/put/post/patch/delete)
980-
:param bool ignore401: indicates whether to ignore 401 error or not
980+
:param bool ignore401: indicates whether to ignore 401 error when it would
981+
indicate that there the token has expired. This is set to 'True' for the
982+
first call to the api, and 'False' for the call that is initiated after a
983+
tpken refresh.
981984
:param kwargs: extra params to send to the request api
982985
:return: Response of the request
983986
:rtype: requests.Response
@@ -1095,7 +1098,7 @@ def naive_request(self, url: str, method: str, **kwargs) -> Response:
10951098
# lazy creation of a naive session
10961099
self.naive_session = self.get_naive_session()
10971100

1098-
return self._internal_request(self.naive_session, url, method, ignore401=False **kwargs)
1101+
return self._internal_request(self.naive_session, url, method, ignore401=False, **kwargs)
10991102

11001103
def oauth_request(self, url: str, method: str, **kwargs) -> Response:
11011104
"""Makes a request to url using an oauth session.

0 commit comments

Comments
 (0)