Arg... spelling!
[htsworkflow.git] / htsworkflow / frontend / samples / views.py
index e64ce6748660c8034b4e8589399fed138a1a6d8b..abc4c6ea63f2038345e8bf3d17390bc37af96cfb 100644 (file)
@@ -320,17 +320,19 @@ def _make_eland_results(flowcell_id, lane, interesting_flowcells):
     if cur_fc is None:
       return []
 
+    flowcell = FlowCell.objects.get(flowcell_id=flowcell_id)
     # Loop throw storage devices if a result has been archived
     storage_id_list = []
-    for lts in cur_fc.longtermstorage_set.all():
-        for sd in lts.storage_devices.all():
-            # Use barcode_id if it exists
-            if sd.barcode_id is not None and sd.barcode_id != '':
-                storage_id_list.append(sd.barcode_id)
-            # Otherwise use UUID
-            else:
-                storage_id_list.append(sd.uuid)
-    
+    if cur_fc is not None:
+        for lts in flowcell.longtermstorage_set.all():
+            for sd in lts.storage_devices.all():
+                # Use barcode_id if it exists
+                if sd.barcode_id is not None and sd.barcode_id != '':
+                    storage_id_list.append(sd.barcode_id)
+                # Otherwise use UUID
+                else:
+                    storage_id_list.append(sd.uuid)
+        
     # Formatting for template use
     if len(storage_id_list) == 0:
         storage_ids = None