Commit 4ed6a2f5 authored by Rémi Duraffort's avatar Rémi Duraffort Committed by Neil Williams

api: fix a crash when a test case is not unique

Change-Id: Ie98449b849e5cdd3de6d16a6902750f6f546a146
parent 6eadfc62
......@@ -667,8 +667,8 @@ class ResultsAPI(ExposedAPI):
raise xmlrpclib.Fault(
401, "Permission denied for user to job %s" % job_id)
test_suite = job.testsuite_set.get(name=suite_name)
test_case = test_suite.testcase_set.get(name=case_name)
yaml_list = [export_testcase(test_case)]
test_cases = test_suite.testcase_set.filter(name=case_name)
yaml_list = [export_testcase(test_case) for test_case in test_cases]
except TestJob.DoesNotExist:
raise xmlrpclib.Fault(404, "Specified job not found.")
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment