Commit 7d6c466c by Dave St.Germain

Merge pull request #4612 from edx/dcs/matlab-api-tweak

A better check for the existence of matlabinput element.
parents 739ee04f 467cf34c
......@@ -1879,7 +1879,7 @@ class CodeResponse(LoncapaResponse):
# matlab api key can be defined in course settings. if so, add it to the grader payload
api_key = getattr(self.capa_system, 'matlab_api_key', None)
if self.xml.find('matlabinput') and api_key:
if api_key and self.xml.find('matlabinput') is not None:
self.payload['token'] = api_key
self.payload['endpoint_version'] = "2"
self.payload['requestor_id'] = self.capa_system.anonymous_student_id
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment