aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilipp Lepalaan <f@230.to>2013-05-13 20:04:21 +0300
committerFilipp Lepalaan <f@230.to>2013-05-13 20:04:21 +0300
commitd020b5d452b85becd77b1d1a76e01751c8aa2f05 (patch)
treec7863ee983fec074aad6793d000809428ab93d69
parent4ebc7f7eae508fcf5a3031e1eeadba4183589136 (diff)
downloadpy-gsxws-d020b5d452b85becd77b1d1a76e01751c8aa2f05.tar.gz
py-gsxws-d020b5d452b85becd77b1d1a76e01751c8aa2f05.tar.bz2
py-gsxws-d020b5d452b85becd77b1d1a76e01751c8aa2f05.zip
Fix bool type check in GsxObject
-rw-r--r--gsxws/core.py9
-rw-r--r--gsxws/repairs.py3
2 files changed, 5 insertions, 7 deletions
diff --git a/gsxws/core.py b/gsxws/core.py
index 4e35c76..2579310 100644
--- a/gsxws/core.py
+++ b/gsxws/core.py
@@ -300,6 +300,9 @@ class GsxObject(object):
value = base64.b64encode(value.read())
+ if isinstance(value, bool):
+ value = "Y" if value else "N"
+
if isinstance(value, int):
value = str(value)
@@ -309,12 +312,6 @@ class GsxObject(object):
if isinstance(value, time):
value = value.strftime(self._formats['tf'])
- if isinstance(value, bool):
- value = "Y" if value else "N"
-
- if isinstance(value, date):
- value = value.strftime(self._formats['df'])
-
self._data[name] = value
def __getattr__(self, name):
diff --git a/gsxws/repairs.py b/gsxws/repairs.py
index 5ba0861..4d0d1f5 100644
--- a/gsxws/repairs.py
+++ b/gsxws/repairs.py
@@ -181,7 +181,8 @@ class CarryInRepair(Repair):
GSX validates the information and if all of the validations go through,
it obtains a quote for the repair and creates the carry-in repair
- >>> CarryInRepair(customerAddress=Customer(firstName='Filipp'))._data
+ >>> CarryInRepair(requestReviewByApple=True).requestReviewByApple
+ 'Y'
"""
_namespace = "emea:"