aboutsummaryrefslogtreecommitdiffstats
path: root/servo/models
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2015-10-13 22:43:45 +0300
committerFilipp Lepalaan <filipp@mac.com>2015-10-13 22:43:45 +0300
commite9b0f10c534c10b239301a58f8c00a4effe9adbf (patch)
tree0e5f1c844e204743b906e4c00c21fc5489b985c7 /servo/models
parent5d5415d29daa990d27913da638a6e2bc30afb4e8 (diff)
downloadServo-e9b0f10c534c10b239301a58f8c00a4effe9adbf.tar.gz
Servo-e9b0f10c534c10b239301a58f8c00a4effe9adbf.tar.bz2
Servo-e9b0f10c534c10b239301a58f8c00a4effe9adbf.zip
AST 2fixes
Diffstat (limited to 'servo/models')
-rw-r--r--servo/models/device.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/servo/models/device.py b/servo/models/device.py
index fdd5614..cf3b861 100644
--- a/servo/models/device.py
+++ b/servo/models/device.py
@@ -203,7 +203,7 @@ class Device(models.Model):
@property
def has_warranty(self):
- return self.warranty_status in ('ALW', 'APP', 'CBC')
+ return self.warranty_status in ('ALW', 'APP', 'CBC',)
@property
def tag_choices(self):
@@ -475,6 +475,21 @@ class Device(models.Model):
return countries.countries.get(self.purchase_country, '')
+ def run_test(self, test_id, request):
+ from gsxws import diagnostics
+ GsxAccount.default(request.user)
+ diags = diagnostics.Diagnostics(self.sn)
+ diags.shipTo = request.user.location.gsx_shipto
+ diags.diagnosticSuiteId = test_id
+ return diags.run_test()
+
+ def fetch_tests(self, request):
+ from gsxws import diagnostics
+ GsxAccount.default(request.user)
+ diags = diagnostics.Diagnostics(self.sn)
+ diags.shipTo = request.user.location.gsx_shipto
+ return diags.fetch_suites()
+
def __unicode__(self):
return '%s (%s)' % (self.description, self.sn)