From e2567235643a6d1c804568fd4051e3705812cded Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Wed, 11 Sep 2013 20:54:36 +0300 Subject: Set dispatchId after repair creation --- gsxws/repairs.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'gsxws') 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('<>', p.deliveryTrackingNumber, p.carrierURL) + url = p.carrierURL.replace('<>', 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): """ -- cgit v1.2.3