Rename HttpResponse parameter mimetype to content_type
authorDiane Trout <diane@caltech.edu>
Wed, 7 May 2014 00:00:14 +0000 (17:00 -0700)
committerDiane Trout <diane@ghic.org>
Tue, 10 Jun 2014 23:40:48 +0000 (16:40 -0700)
The old name was deprecated in django 1.5 and dropped in django 1.7

htsworkflow/frontend/experiments/experiments.py
htsworkflow/frontend/experiments/views.py
htsworkflow/frontend/samples/views.py

index fef68ed130526e33400302db57de772d82b81ade..e9bb3151a23330b72f80c7773ab052795abec178 100644 (file)
@@ -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):
     """
index 28a355f97271f65ba80d0e18502a03f55b93f652..38b0e98255a105ed22c13893df3eb62db154a69e 100644 (file)
@@ -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
 
index 2e0b07d41db09053043ceaebde06c8ce35830ebd..fcd5314e65a4de0e1beabb16d7716330896f2615 100644 (file)
@@ -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):