@tornado.gen.coroutine
    def get(self, portid):
        portid = ObjectId(portid)
        portal = yield self.check_external_portal(portid)
        
        if self.twsessionstatus is not 'auth':
            # Set a one-hour cookie. We presume that the player can
            # register or log in within an hour.
            self.set_cookie('tworld_portlink', str(portid),
                            expires_days=0.05)
            self.redirect('/')
            return

        # Add the link to the player's personal list, if it's not already.
        # This also sets the focus.
        uid = self.twsession['uid']
        msg = { 'cmd':'externalcopyportal', 'uid':str(uid),
                'portid':str(portid), 'focus':True }
        self.application.twservermgr.tworld_write(0, msg)

        # Check whether the player has an active web session.
        ls = self.application.twconntable.for_uid(uid)
        if not ls:
            # Redirect to the play page.
            self.redirect('/play')
            return

        # Display a success message (with a play link, in case the player
        # wants that). Also the portal info, which we belatedly stuff
        # into self.twportlink.
        self.twportlink = yield self.external_portal_description(portid, done=True)
        self.render('portlink.html')
dataset/ETHPy150Open erkyrath/tworld/lib/tweblib/handlers.py/PortLinkHandler.get/operator `!=` -> `is not`