Return species information as part of the flowcell json information.
[htsworkflow.git] / htsworkflow / frontend / samples / views.py
index 7e865ac62228fa2559442e45782bcd5dd40b0308..b0a61f42117db2c1758b933041e64f0cb2377cb4 100644 (file)
@@ -7,6 +7,7 @@ try:
 except ImportError, e:
     import simplejson as json
 
+from htsworkflow.frontend.auth import require_api_key
 from htsworkflow.frontend.experiments.models import FlowCell
 from htsworkflow.frontend.samples.changelist import ChangeList
 from htsworkflow.frontend.samples.models import Library
@@ -491,11 +492,11 @@ def library_dict(library_id):
         info['library_type'] = lib.library_type.name
     return info
 
-@login_required
 def library_json(request, library_id):
     """
     Return a json formatted library dictionary
     """
+    require_api_key(request)
     # what validation should we do on library_id?
     
     lib = library_dict(library_id)
@@ -504,6 +505,12 @@ def library_json(request, library_id):
 
     lib_json = json.dumps(lib)
     return HttpResponse(lib_json, mimetype='application/json')
+
+def species_json(request, species_id):
+    """
+    Return information about a species.
+    """
+    raise Http404
     
 @login_required
 def user_profile(request):
@@ -519,3 +526,4 @@ def user_profile(request):
     context.update(SAMPLES_CONTEXT_DEFAULTS)
     return render_to_response('registration/profile.html', context,
                               context_instance=RequestContext(request))
+