def construct_came_from(environ):
 came_from = environ.get('PATH_INFO')
 qstr = environ.get('QUERY_STRING', '')
 if qstr:
  came_from += ('?' + qstr)
 return came_from

def construct_came_from ( environ ) : came_from = environ . get ( 'PATH_INFO' ) qstr = environ . get ( 'QUERY_STRING' , '' ) if qstr : came_from += ( '?' + qstr ) return came_from
the url that the user used when the process where interupted for single-sign-on processing .