From e9b0f10c534c10b239301a58f8c00a4effe9adbf Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Tue, 13 Oct 2015 22:43:45 +0300 Subject: AST 2fixes --- servo/models/device.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'servo/models/device.py') 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) -- cgit v1.2.3