diff options
Diffstat (limited to 'servo/views/diagnostics.py')
-rw-r--r-- | servo/views/diagnostics.py | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/servo/views/diagnostics.py b/servo/views/diagnostics.py index 5e2d222..211600d 100644 --- a/servo/views/diagnostics.py +++ b/servo/views/diagnostics.py @@ -38,12 +38,29 @@ class DiagnosticResults(object): def run_test(request, device, test_id): device = get_object_or_404(Device, pk=device) + GsxAccount.default(request.user) + try: - device.run_test(test_id, request) + result = device.run_test(test_id, request) + messages.success(request, result.responseMessage) except Exception as e: messages.error(request, e) + + return redirect(request.session['return_to']) +def fetch_dc_url(request): + from gsxws.diagnostics import Diagnostics + GsxAccount.default(request.user) + ship_to = request.user.location.gsx_shipto + diags = Diagnostics(shipTo=ship_to) + + try: + return redirect(diags.fetch_dc_url()) + except Exception as e: + return messages.error(request, e) + + def select_test(request, pk): """ Fetch test suite selector |