'If configured, send the submission\'s grader payload to another service.'

def _register_submission(self, xqueue_body_json):

    url = self.server.config.get('register_submission_url')
    if (url is not None):
        try:
            xqueue_body = json.loads(xqueue_body_json)
        except ValueError:
            self.log_error("Could    not    decode    XQueue    body    as    JSON:    '{0}'".format(xqueue_body_json))
        else:
            grader_payload = xqueue_body.get('grader_payload')
            if (grader_payload is not None):
                response = post(url, data={'grader_payload': grader_payload})
                if (not response.ok):
                    self.log_error("Could    register    submission    at    URL    '{0}'.        Status    was    {1}".format(url, response.status_code))
            else:
                self.log_message("XQueue    body    is    missing    'grader_payload'    key:    '{0}'".format(xqueue_body))
