'Assert username. Raise redirect, or return True if request handled.'

def do_check(self):

    sess = cherrypy.session
    request = cherrypy.serving.request
    response = cherrypy.serving.response
    username = sess.get(self.session_key)
    if (not username):
        sess[self.session_key] = username = self.anonymous()
        self._debug_message('No    session[username],    trying    anonymous')
    if (not username):
        url = cherrypy.url(qs=request.query_string)
        self._debug_message('No    username,    routing    to    login_screen    with    from_page    %(url)r', locals())
        response.body = self.login_screen(url)
        if ('Content-Length' in response.headers):
            del response.headers['Content-Length']
        return True
    self._debug_message('Setting    request.login    to    %(username)r', locals())
    request.login = username
    self.on_check(username)
