Skip to content

Commit

Permalink
closes #14
Browse files Browse the repository at this point in the history
  • Loading branch information
jobelenus committed Sep 27, 2017
1 parent a7a7f96 commit 70b05b2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pyavatax/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION = (1, 3, 8)
VERSION = (1, 3, 9)


def get_version():
Expand Down
9 changes: 4 additions & 5 deletions pyavatax/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def update(self, *args, **kwargs):
if isinstance(_v, klass):
getattr(self, k).append(_v)
elif isinstance(_v, dict):
getattr(self, k).append(klass(allow_new_fields=self.allow_new_fields,**_v))
getattr(self, k).append(klass(allow_new_fields=self.allow_new_fields, **_v))
else:
self._invalid_field(k)
self.clean()
Expand Down Expand Up @@ -179,7 +179,6 @@ def _request(self, http_method, stem, data={}, params={}):
data = data.replace('\\n', ' ')
kwargs = {
'params': params,
'data': data,
'headers': self.headers,
'auth': (self.username, self.password),
'proxies': self.proxies,
Expand All @@ -190,6 +189,7 @@ def _request(self, http_method, stem, data={}, params={}):
if http_method == 'GET':
resp = requests.get(url, **kwargs)
elif http_method == 'POST':
kwargs.update({'data': data})
resp = requests.post(url, **kwargs)
except (requests.exceptions.ConnectionError, requests.exceptions.SSLError, requests.exceptions.HTTPError, requests.exceptions.Timeout) as e:
self.logger.warning(e)
Expand Down Expand Up @@ -307,7 +307,7 @@ class AvalaraValidationException(AvalaraException):

class AvalaraServerNotReachableException(AvalaraBaseException):
"""Raised when the AvaTax service is unreachable for any reason and no response is received"""

def __init__(self, request_exception, *args, **kwargs):
self.request_exception = request_exception

Expand Down Expand Up @@ -376,7 +376,6 @@ class Document(AvalaraBase):
CANCEL_ADJUSTMENT_CANCELED = 'AdjustmentCanceled'
CANCEL_CODES = (CANCEL_POST_FAILED, CANCEL_DOC_DELETED, CANCEL_DOC_VOIDED, CANCEL_ADJUSTMENT_CANCELED)


_fields = ['DocType', 'DocId', 'DocCode', 'DocDate', 'CompanyCode', 'CustomerCode', 'Discount', 'Commit', 'CustomerUsageType', 'PurchaseOrderNo', 'ExemptionNo', 'PaymentDate', 'ReferenceCode', 'PosLaneCode', 'Client']
_contains = ['Lines', 'Addresses'] # the automatic parsing in `def update` doesn't work here, but its never invoked here
_has = ['DetailLevel', 'TaxOverride']
Expand Down Expand Up @@ -601,7 +600,7 @@ class TaxOverride(AvalaraBase):
OVERRIDE_AMOUNT = 'TaxAmount'
OVERRIDE_DATE = 'TaxDate'
OVERRIDE_EXEMPT = 'Exemption'
OVERRIDE_TYPES = ( OVERRIDE_NONE, OVERRIDE_AMOUNT, OVERRIDE_DATE, OVERRIDE_EXEMPT )
OVERRIDE_TYPES = (OVERRIDE_NONE, OVERRIDE_AMOUNT, OVERRIDE_DATE, OVERRIDE_EXEMPT)
_fields = ['TaxOverrideType', 'TaxAmount', 'TaxDate', 'Reason']

@staticmethod
Expand Down

0 comments on commit 70b05b2

Please sign in to comment.