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