Rename HttpResponse parameter mimetype to content_type
[htsworkflow.git] / htsworkflow / frontend / experiments / views.py
index 5d4283da67288868b1e2a0bd0fd26bcfc78a3435..38b0e98255a105ed22c13893df3eb62db154a69e 100644 (file)
@@ -103,9 +103,15 @@ def startedEmail(request, pk):
 
         if send:
             email = EmailMessage(subject, body, sender, to=[user_email])
+            notified = set()
             if bcc_managers:
-                email.bcc = settings.MANAGERS
-            email.bcc = settings.NOTIFICATION_BCC
+                for manager in settings.MANAGERS:
+                    if len(manager) > 0:
+                        notified.add(manager)
+            for user in settings.NOTIFICATION_BCC:
+                if len(user) > 0:
+                    notified.add(user)
+            email.bcc = list(notified)
             email.send()
 
         emails.append((user_email, subject, body, sending))
@@ -171,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