Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions cbpro/public_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,10 @@ def _send_message(self, method, endpoint, params=None, data=None):

"""
url = self.url + endpoint
if self.auth is not None and not all([
self.auth.api_key, self.auth.passphrase, self.auth.secret_key,
]):
self.auth = None
r = self.session.request(method, url, params=params, data=data,
auth=self.auth, timeout=30)
return r.json()
Expand Down Expand Up @@ -295,6 +299,11 @@ def _send_paginated_message(self, endpoint, params=None):
if params is None:
params = dict()
url = self.url + endpoint

if self.auth is not None and not all([
self.auth.api_key, self.auth.passphrase, self.auth.secret_key,
]):
self.auth = None
while True:
r = self.session.get(url, params=params, auth=self.auth, timeout=30)
results = r.json()
Expand Down