X-Git-Url: http://woldlab.caltech.edu/gitweb/?a=blobdiff_plain;f=htsworkflow%2Ffrontend%2Finventory%2Fviews.py;fp=htsworkflow%2Ffrontend%2Finventory%2Fviews.py;h=226ef8a36674a2f65e12f1c05067fa1261811804;hb=53ebb47e86e81ce349d4ef4e16aef94be93486ea;hp=265e1bc74f43d74d53957401a20d018c043ac170;hpb=4262586d10cc0cc227390873b301b55244204c11;p=htsworkflow.git diff --git a/htsworkflow/frontend/inventory/views.py b/htsworkflow/frontend/inventory/views.py index 265e1bc..226ef8a 100644 --- a/htsworkflow/frontend/inventory/views.py +++ b/htsworkflow/frontend/inventory/views.py @@ -19,7 +19,7 @@ register_search_plugin('Inventory Item', item_search) try: import json -except ImportError, e: +except ImportError as e: import simplejson as json INVENTORY_CONTEXT_DEFAULTS = { @@ -88,7 +88,7 @@ def getPrinterTemplateByType(item_type): printer_template = PrinterTemplate.objects.get(default=True) except ObjectDoesNotExist: msg = "No template for item type (%s) and no default template found" % (item_type.name) - raise ValueError, msg + raise ValueError(msg) return printer_template @@ -214,7 +214,7 @@ def item_summary_by_barcode(request, barcode_id, msg=''): """ try: item = Item.objects.get(barcode_id=barcode_id) - except ObjectDoesNotExist, e: + except ObjectDoesNotExist as e: item = None return item_summary_by_uuid(request, None, msg, item) @@ -229,7 +229,7 @@ def item_summary_by_uuid(request, uuid, msg='', item=None): if item is None: try: item = Item.objects.get(uuid=uuid) - except ObjectDoesNotExist, e: + except ObjectDoesNotExist as e: item = None context_dict = { @@ -289,7 +289,7 @@ def item_print(request, uuid): """ try: item = Item.objects.get(uuid=uuid) - except ObjectDoesNotExist, e: + except ObjectDoesNotExist as e: item = None msg = "Item with UUID %s does not exist" % (uuid) @@ -314,7 +314,7 @@ def link_flowcell_and_device(request, flowcell, serial): # Retrieve Storage Device try: sd = Item.objects.get(barcode_id=serial) - except ObjectDoesNotExist, e: + except ObjectDoesNotExist as e: msg = "Item with barcode_id of %s not found." % (serial) raise ObjectDoesNotExist(msg) @@ -322,7 +322,7 @@ def link_flowcell_and_device(request, flowcell, serial): # Retrieve FlowCell try: fc = FlowCell.objects.get(flowcell_id__startswith=flowcell) - except ObjectDoesNotExist, e: + except ObjectDoesNotExist as e: msg = "FlowCell with flowcell_id of %s not found." % (flowcell) raise ObjectDoesNotExist(msg) @@ -332,7 +332,7 @@ def link_flowcell_and_device(request, flowcell, serial): lts = None if count > 1: msg = "There really should only be one longtermstorage object per flowcell" - raise ValueError, msg + raise ValueError(msg) elif count == 1: # lts already attached to flowcell lts = fc.longtermstorage_set.all()[0]