def _get_design(user, design_id):
 try:
  return Document.objects.can_read_or_exception(user, Workflow, doc_id=design_id).content_object
 except Workflow.DoesNotExist:
  raise PopupException(_('Workflow not found'))

def _get_design ( user , design_id ) : try : return Document . objects . can_read_or_exception ( user , Workflow , doc_id = design_id ) . content_object except Workflow . DoesNotExist : raise PopupException ( _ ( 'Workflow not found' ) )
raise popupexception if design doesnt exist .