def _get_verify_flow_redirect(order):
 cert_items = CertificateItem.objects.filter(order=order)
 if (cert_items.count() > 0):
  if (cert_items.count() > 1):
   log.warning(u'More than one certificate item in order %s; continuing with the payment/verification flow for the first order item (course %s).', order.id, cert_items[0].course_id)
  course_id = cert_items[0].course_id
  url = reverse('verify_student_payment_confirmation', kwargs={'course_id': unicode(course_id)})
  url += '?payment-order-num={order_num}'.format(order_num=order.id)
  return HttpResponseRedirect(url)

def _get_verify_flow_redirect ( order ) : cert_items = CertificateItem . objects . filter ( order = order ) if ( cert_items . count ( ) > 0 ) : if ( cert_items . count ( ) > 1 ) : log . warning ( u'More than one certificate item in order %s; continuing with the payment/verification flow for the first order item (course %s).' , order . id , cert_items [ 0 ] . course_id ) course_id = cert_items [ 0 ] . course_id url = reverse ( 'verify_student_payment_confirmation' , kwargs = { 'course_id' : unicode ( course_id ) } ) url += '?payment-order-num={order_num}' . format ( order_num = order . id ) return HttpResponseRedirect ( url )
check if were in the verification flow and redirect if necessary .