Commit 504d008d authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_jio: Set Proper Content-Type on the response

parent af16f03d
......@@ -13,6 +13,7 @@ else:
compute_node = context.restrictedTraverse(context.REQUEST.get('compute_node'))
compute_node.generateCertificate()
response.setHeader('Content-Type', "application/json")
return json.dumps({
"certificate" : request.get('compute_node_certificate'),
"key" : request.get('compute_node_key'),
......
......@@ -10,9 +10,10 @@ if person is None:
else:
request_kw = dict(network_title=title)
person.requestNetwork(**request_kw)
network_relative_url = context.REQUEST.get('computer_network_relative_url')
network_reference = context.REQUEST.get('computer_network_reference')
network_relative_url = request.get('computer_network_relative_url')
network_reference = request.get('computer_network_reference')
response.setHeader('Content-Type', "application/json")
return json.dumps({
"reference": network_reference,
"relative_url": network_relative_url
......
......@@ -10,9 +10,10 @@ if person is None:
else:
request_kw = dict(organisation_title=title)
person.requestOrganisation(**request_kw)
organisation_relative_url = context.REQUEST.get('organisation_relative_url')
organisation_reference = context.REQUEST.get('organisation_reference')
organisation_relative_url = request.get('organisation_relative_url')
organisation_reference = request.get('organisation_reference')
response.setHeader('Content-Type', "application/json")
return json.dumps({
"reference": organisation_reference,
"relative_url": organisation_relative_url
......
......@@ -10,9 +10,10 @@ if person is None:
else:
request_kw = dict(project_title=title)
person.requestProject(**request_kw)
project_relative_url = context.REQUEST.get('project_relative_url')
project_reference = context.REQUEST.get('project_reference')
project_relative_url = request.get('project_relative_url')
project_reference = request.get('project_reference')
response.setHeader('Content-Type', "application/json")
return json.dumps({
"reference": project_reference,
"relative_url": project_relative_url
......
......@@ -10,9 +10,10 @@ if person is None:
else:
request_kw = dict(organisation_title=title)
person.requestSite(**request_kw)
organisation_relative_url = context.REQUEST.get('organisation_relative_url')
organisation_reference = context.REQUEST.get('organisation_reference')
organisation_relative_url = request.get('organisation_relative_url')
organisation_reference = request.get('organisation_reference')
response.setHeader('Content-Type', "application/json")
return json.dumps({
"reference": organisation_reference,
"relative_url": organisation_relative_url
......
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