From: Diane Trout Date: Wed, 7 May 2014 00:00:14 +0000 (-0700) Subject: Rename HttpResponse parameter mimetype to content_type X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=htsworkflow.git;a=commitdiff_plain;h=5314f4335f53e1b36875c2ad0177fbb8623d3c64 Rename HttpResponse parameter mimetype to content_type The old name was deprecated in django 1.5 and dropped in django 1.7 --- diff --git a/htsworkflow/frontend/experiments/experiments.py b/htsworkflow/frontend/experiments/experiments.py index fef68ed..e9bb315 100644 --- a/htsworkflow/frontend/experiments/experiments.py +++ b/htsworkflow/frontend/experiments/experiments.py @@ -93,7 +93,7 @@ def flowcell_json(request, fc_id): raise Http404 fc_json = json.dumps(fc_dict) - return HttpResponse(fc_json, mimetype = 'application/json') + return HttpResponse(fc_json, content_type = 'application/json') def lanes_for(username=None): """ @@ -135,7 +135,7 @@ def lanes_for_json(request, username): #convert query set to python structure result_json = json.dumps(result) - return HttpResponse(result_json, mimetype='application/json') + return HttpResponse(result_json, content_type='application/json') def updStatus(request): @@ -260,7 +260,7 @@ def getConfile(req): except ObjectDoesNotExist: cnfgfile = 'Entry not found for RunFolder = '+runfolder - return HttpResponse(cnfgfile, mimetype='text/plain') + return HttpResponse(cnfgfile, content_type='text/plain') def getLaneLibs(req): granted = False @@ -301,7 +301,7 @@ def getLaneLibs(req): outputfile = 'Flowcell entry not found for: '+fcid else: outputfile = 'Missing input: flowcell id' - return HttpResponse(outputfile, mimetype='text/plain') + return HttpResponse(outputfile, content_type='text/plain') def estimateFlowcellDuration(flowcell): """ diff --git a/htsworkflow/frontend/experiments/views.py b/htsworkflow/frontend/experiments/views.py index 28a355f..38b0e98 100644 --- a/htsworkflow/frontend/experiments/views.py +++ b/htsworkflow/frontend/experiments/views.py @@ -177,13 +177,13 @@ def read_result_file(self, key): """ data_file = get_object_or_404(DataFile, random_key = key) - mimetype = 'application/octet-stream' + content_type = 'application/octet-stream' if data_file.file_type.mimetype is not None: - mimetype = data_file.file_type.mimetype + content_type = data_file.file_type.mimetype if os.path.exists(data_file.pathname): return HttpResponse(open(data_file.pathname,'r'), - mimetype=mimetype) + content_type=content_type) raise Http404 diff --git a/htsworkflow/frontend/samples/views.py b/htsworkflow/frontend/samples/views.py index 2e0b07d..fcd5314 100644 --- a/htsworkflow/frontend/samples/views.py +++ b/htsworkflow/frontend/samples/views.py @@ -230,10 +230,10 @@ def result_fc_cnm_eland_lane(request, flowcell_id, cnm, lane): filepath = erd[lane] #f = opener.autoopen(filepath, 'r') - # return HttpResponse(f, mimetype="application/x-elandresult") + # return HttpResponse(f, content_type="application/x-elandresult") f = open(filepath, 'r') - return HttpResponse(f, mimetype='application/x-bzip2') + return HttpResponse(f, content_type='application/x-bzip2') @@ -276,7 +276,7 @@ def bedfile_fc_cnm_eland_lane(request, flowcell_id, cnm, lane, ucsc_compatible=F if ucsc_compatible: return HttpResponse(bedgen) else: - return HttpResponse(bedgen, mimetype="application/x-bedfile") + return HttpResponse(bedgen, content_type="application/x-bedfile") def _summary_stats(flowcell_id, lane_id, library_id): @@ -526,7 +526,7 @@ def library_json(request, library_id): raise Http404 lib_json = json.dumps(lib) - return HttpResponse(lib_json, mimetype='application/json') + return HttpResponse(lib_json, content_type='application/json') @csrf_exempt def species_json(request, species_id):