def get_redirect():
 return_to = request.params.get('return_to')
 hash_given = request.params.get('hash', '')
 if (not (return_to and hash_given)):
  return None
 hash_expected = get_message_hash(return_to)
 if (hash_given == hash_expected):
  return return_to.encode('utf-8')
 return None

def get_redirect ( ) : return_to = request . params . get ( 'return_to' ) hash_given = request . params . get ( 'hash' , '' ) if ( not ( return_to and hash_given ) ) : return None hash_expected = get_message_hash ( return_to ) if ( hash_given == hash_expected ) : return return_to . encode ( 'utf-8' ) return None
checks the return_to value against the hash .