diff --git a/changelog.rst b/changelog.rst index 60696b1..41ee768 100644 --- a/changelog.rst +++ b/changelog.rst @@ -5,6 +5,14 @@ Changelog *************** +.. _1.3.3: + +Version 1.3.3 +------------- +* Fix Team_V3.get_workdiaries - parameters were not sent +* Default `timeout` parameter for urllib3 has been set to the maximum 8 seconds +* The `retries` parameter for urllib3 has been set to `False` + .. _1.3.2: Version 1.3.2 diff --git a/setup.py b/setup.py index 5a56a21..cc2ae48 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ README = readme.read() readme.close() -VERSION = (1, 3, 2, 0, 0) +VERSION = (1, 3, 3, 0, 0) def get_version(): diff --git a/upwork/__init__.py b/upwork/__init__.py index ea15ddb..04fee31 100644 --- a/upwork/__init__.py +++ b/upwork/__init__.py @@ -13,7 +13,7 @@ """ -VERSION = '1.3.2' +VERSION = '1.3.3' def get_version(): diff --git a/upwork/client.py b/upwork/client.py index b7d0234..e528949 100644 --- a/upwork/client.py +++ b/upwork/client.py @@ -90,7 +90,7 @@ class Client(object): Whether to attach :py:mod:`upwork.routers.job` router - :timeout: (optional, default ``3 secs``) + :timeout: (optional, default ``8 secs``) Socket operations timeout. """ @@ -98,7 +98,7 @@ def __init__(self, public_key, secret_key, oauth_access_token=None, oauth_access_token_secret=None, fmt='json', finreport=True, hr=True, messages=True, offers=True, provider=True, task=True, team=True, - timereport=True, job=True, timeout=3): + timereport=True, job=True, timeout=8): self.public_key = public_key self.secret_key = secret_key @@ -117,8 +117,8 @@ def __init__(self, public_key, secret_key, self.http = urllib3.PoolManager( cert_reqs='CERT_REQUIRED', ca_certs=ca_certs_locater.get(), - timeout=int(timeout), - retries=Retry(2, backoff_factor=0.5) + timeout=urllib3.Timeout(connect=0.5, read=float(timeout)), + retries=False ) self.oauth_access_token = oauth_access_token diff --git a/upwork/routers/team.py b/upwork/routers/team.py index 85ca7b2..222abb0 100644 --- a/upwork/routers/team.py +++ b/upwork/routers/team.py @@ -91,10 +91,6 @@ def get_workdiaries(self, team_id, date, sort_by=None, activity=None, freelancer """ url = 'workdiaries/companies/{0}/{1}'.format(team_id, date) - result = self.get(url) - if 'error' in result: - return result - data = {} if sort_by: @@ -109,6 +105,10 @@ def get_workdiaries(self, team_id, date, sort_by=None, activity=None, freelancer if paging: data['paging'] = paging + result = self.get(url, data) + if 'error' in result: + return result + snapshots = result.get('data', data) if not isinstance(snapshots, list): snapshots = [snapshots]