diff options
author | Andy Doan <andy.doan@linaro.org> | 2016-02-03 13:23:16 -0600 |
---|---|---|
committer | Andy Doan <andy.doan+gerrit@linaro.org> | 2016-02-10 17:55:47 +0000 |
commit | 0f64aee3664759c0b2a739dc3dcc534204cdb9b1 (patch) | |
tree | 7ad59291c1ce47d967c12d0922d903af2a77e35f | |
parent | f9848acc0e0ff7b2e1b4553091b5be4212caa54e (diff) |
django 1.8: move to updated HttpResponse constructor
Django's HttpResponse constructor now requires "content_type" rather
than "mimetype". In fact django 1.3.7 just supports this mimetype
parameter for backwards compatibility:
https://github.com/django/django/blob/stable/1.3.x/django/http/__init__.py#L506
Change-Id: I021753d94de5b0c3fe8c3a5be613de1adc8ad752
Reviewed-on: https://review.linaro.org/10367
Reviewed-by: Ben Copeland <ben.copeland@linaro.org>
Reviewed-by: pfalcon Sokolovsky <paul.sokolovsky@linaro.org>
-rw-r--r-- | license_protected_downloads/api/v1.py | 4 | ||||
-rw-r--r-- | license_protected_downloads/artifact/local.py | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/license_protected_downloads/api/v1.py b/license_protected_downloads/api/v1.py index 8542b86..e75196f 100644 --- a/license_protected_downloads/api/v1.py +++ b/license_protected_downloads/api/v1.py @@ -108,7 +108,7 @@ def list_files_api(request, path): }) data = json.dumps({"files": clean_listing}) - return HttpResponse(data, mimetype='application/json') + return HttpResponse(data, content_type='application/json') def get_license_api(request, path): @@ -128,4 +128,4 @@ def get_license_api(request, path): for l in license_list] data = json.dumps({"licenses": license_list}) - return HttpResponse(data, mimetype='application/json') + return HttpResponse(data, content_type='application/json') diff --git a/license_protected_downloads/artifact/local.py b/license_protected_downloads/artifact/local.py index d7d5aa8..5aeab65 100644 --- a/license_protected_downloads/artifact/local.py +++ b/license_protected_downloads/artifact/local.py @@ -48,7 +48,7 @@ class LocalArtifact(Artifact): mime = mimetypes.guess_type(file_name)[0] if mime is None: mime = "application/force-download" - response = HttpResponse(mimetype=mime) + response = HttpResponse(content_type=mime) response['Content-Disposition'] = ('attachment; filename=%s' % smart_str(file_name)) response['X-Sendfile'] = smart_str(self.full_path) |