diff options
author | Filipp Lepalaan <f@230.to> | 2013-09-11 20:54:36 +0300 |
---|---|---|
committer | Filipp Lepalaan <f@230.to> | 2013-09-11 20:54:36 +0300 |
commit | e2567235643a6d1c804568fd4051e3705812cded (patch) | |
tree | f4b32e94a830db1924313aefd40a59f55c7559b9 /gsxws | |
parent | 99aad548c68538514712d1f23d16c4c190d76f7c (diff) | |
download | py-gsxws-e2567235643a6d1c804568fd4051e3705812cded.tar.gz py-gsxws-e2567235643a6d1c804568fd4051e3705812cded.tar.bz2 py-gsxws-e2567235643a6d1c804568fd4051e3705812cded.zip |
Set dispatchId after repair creation
Diffstat (limited to 'gsxws')
-rw-r--r-- | gsxws/repairs.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/gsxws/repairs.py b/gsxws/repairs.py index 89eba81..0f45f81 100644 --- a/gsxws/repairs.py +++ b/gsxws/repairs.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- "gsxws/repairs.py" -import re import sys import logging @@ -169,15 +168,15 @@ class Repair(GsxObject): self._namespace = "core:" details = self._submit("RepairDetailsRequest", "RepairDetails", "lookupResponseData") - # fix tracking URL if available + # fix tracking URL, if available for i, p in enumerate(details.partsInfo): try: - url = re.sub('<<TRKNO>>', p.deliveryTrackingNumber, p.carrierURL) + url = p.carrierURL.replace('<<TRKNO>>', p.deliveryTrackingNumber) details.partsInfo[i].carrierURL = url except AttributeError: pass - self.details = details + self._details = details return details @@ -210,7 +209,9 @@ class CarryInRepair(Repair): it obtains a quote for the repair and creates the carry-in repair. """ self._namespace = "emea:" - return self._submit("repairData", "CreateCarryIn", "repairConfirmation") + result = self._submit("repairData", "CreateCarryIn", "repairConfirmation") + self.dispatchId = result.confirmationNumber + return result def update(self, newdata): """ |