From 2ee0710a6f9a3bf309133ac4a9833bdf845870af Mon Sep 17 00:00:00 2001 From: Daniel Rozenberg Date: Tue, 28 Oct 2014 15:20:41 -0700 Subject: [PATCH] Replaces mimetype= with content_type= in calls to HttpResponse, updated for Django 1.6+ --- questionnaire/emails.py | 2 +- questionnaire/views.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/questionnaire/emails.py b/questionnaire/emails.py index 0c68853..d4f5662 100644 --- a/questionnaire/emails.py +++ b/questionnaire/emails.py @@ -156,5 +156,5 @@ def send_emails(request=None, qname=None): outlog.append("Exception: [%s] %s: %s" % (r.runid, r.subject.surname, str(e))) if request: return HttpResponse("Sent Questionnaire Emails:\n " - +"\n ".join(outlog), mimetype="text/plain") + +"\n ".join(outlog), content_type="text/plain") return "\n".join(outlog) diff --git a/questionnaire/views.py b/questionnaire/views.py index abb1c6f..e4feb5f 100644 --- a/questionnaire/views.py +++ b/questionnaire/views.py @@ -218,7 +218,7 @@ def get_async_progress(request, *args, **kwargs): cache.set('progress' + runinfo.random, response['progress']) response = HttpResponse(json.dumps(response), - mimetype='application/javascript'); + content_type='application/javascript'); response["Cache-Control"] = "no-cache" return response @@ -765,7 +765,7 @@ def export_csv(request, qid): # questionnaire_id a if a else '--' for a in answer_row] writer.writerow(row) - response = HttpResponse(FileWrapper(fd), mimetype="text/csv") + response = HttpResponse(FileWrapper(fd), content_type="text/csv") response['Content-Length'] = fd.tell() response['Content-Disposition'] = 'attachment; filename="export-%s.csv"' % qid fd.seek(0)