Disable csrf protection for the json urls
[htsworkflow.git] / htsworkflow / frontend / samples / views.py
index 320559ec1e7ac312b00d5e08ab79a4a9bdf2f2fd..4703cd3ec4d2900b9be62cea224070cd417961ac 100644 (file)
@@ -9,6 +9,7 @@ try:
 except ImportError, e:
     import simplejson as json
 
+from django.contrib.csrf.middleware import csrf_exempt
 from htsworkflow.frontend.auth import require_api_key
 from htsworkflow.frontend.experiments.models import FlowCell, Lane, LANE_STATUS_MAP
 from htsworkflow.frontend.samples.changelist import ChangeList
@@ -490,6 +491,7 @@ def library_dict(library_id):
         info['library_type'] = lib.library_type.name
     return info
 
+@csrf_exempt
 def library_json(request, library_id):
     """
     Return a json formatted library dictionary
@@ -504,6 +506,7 @@ def library_json(request, library_id):
     lib_json = json.dumps(lib)
     return HttpResponse(lib_json, mimetype='application/json')
 
+@csrf_exempt
 def species_json(request, species_id):
     """
     Return information about a species.