Merge "Rewrite pieces of code deprecated by Django 1.7"

This commit is contained in:
Jenkins 2014-01-23 01:42:58 +00:00 committed by Gerrit Code Review
commit 1fdac75d4f
5 changed files with 5 additions and 5 deletions

View File

@ -206,4 +206,4 @@ class SamplesView(TemplateView):
ret['settings'] = {}
return HttpResponse(json.dumps(ret),
mimetype='application/json')
content_type='application/json')

View File

@ -94,7 +94,7 @@ def download_ec2_bundle(request):
redirect=request.build_absolute_uri())
# Send it back
response = http.HttpResponse(mimetype='application/zip')
response = http.HttpResponse(content_type='application/zip')
response.write(temp_zip.read())
response['Content-Disposition'] = ('attachment; '
'filename="%s-x509.zip"'

View File

@ -73,7 +73,7 @@ class GenerateView(View):
_('Unable to create key pair: %(exc)s'),
redirect=redirect)
response = http.HttpResponse(mimetype='application/binary')
response = http.HttpResponse(content_type='application/binary')
response['Content-Disposition'] = \
'attachment; filename=%s.pem' % slugify(keypair.name)
response.write(keypair.private_key)

View File

@ -134,7 +134,7 @@ def console(request, instance_id):
except Exception:
data = _('Unable to get log for instance "%s".') % instance_id
exceptions.handle(request, ignore=True)
response = http.HttpResponse(mimetype='text/plain')
response = http.HttpResponse(content_type='text/plain')
response.write(data)
response.flush()
return response

View File

@ -220,4 +220,4 @@ class JSONView(View):
self.add_resource_url('horizon:project:routers:detail',
data['routers'])
json_string = json.dumps(data, ensure_ascii=False)
return HttpResponse(json_string, mimetype='text/json')
return HttpResponse(json_string, content_type='text/json')