From 449acd488373af847ee27aabf4da9a5f6c2b52a9 Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Tue, 11 Jun 2013 17:03:25 +0300 Subject: Adding warranty status check with IMEI code (WIP) --- gsxws/products.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'gsxws/products.py') diff --git a/gsxws/products.py b/gsxws/products.py index 3042109..ea2e648 100644 --- a/gsxws/products.py +++ b/gsxws/products.py @@ -52,6 +52,10 @@ class Product(GsxObject): >>> Product('DGKFL06JDHJP').warranty().estimatedPurchaseDate datetime.date(2011, 6, 2) """ + if hasattr(self, "alternateDeviceId"): + if not self.serialNumber: + self.activation() + self._submit("unitDetail", "WarrantyStatus", "warrantyDetailInfo") self.warrantyDetails = self._req.objects return self.warrantyDetails @@ -108,10 +112,11 @@ class Product(GsxObject): GsxError: Provided serial number does not belong to an iOS Device... """ self._namespace = "glob:" - act = self._submit("FetchIOSActivationDetailsRequest", - "FetchIOSActivationDetails", - "activationDetailsInfo") - return act + ad = self._submit("FetchIOSActivationDetailsRequest", + "FetchIOSActivationDetails", + "activationDetailsInfo") + self.serialNumber = ad.serialNumber + return ad if __name__ == '__main__': -- cgit v1.2.3