Invalid library IDs should 404, not return a useless error message
[htsworkflow.git] / htsworkflow / frontend / samples / views.py
index 0159a9a73a5f53db10abcd0d93456e824e5118f2..2a8014b6cb1b75ead4f9985baf9c530969085c15 100644 (file)
@@ -116,11 +116,10 @@ def library_to_flowcells(request, lib_id):
     """
     Display information about all the flowcells a library has been run on.
     """
-
     try:
-      lib = Library.objects.get(id=lib_id)
+        lib = Library.objects.get(id=lib_id)
     except:
-      return HttpResponse("Library %s does not exist" % (lib_id))
+        raise Http404('Library %s does not exist' % (lib_id,))
 
     flowcell_list = []
     flowcell_run_results = {} # aka flowcells we're looking at