Ejemplo n.º 1
0
    def POST(self):
        data = web.input()
        user = User(
            email=data.email,
            password=data.password
        )

        login_response = user.login()
        if login_response == 0:
            return web.seeother('/@'+self.session.user.username)
        else:
            return self.render('signin.html',error=login_response)
Ejemplo n.º 2
0
    def POST(self):
        data = web.input()
        user = User(
            username=data.username,
            email=data.email,
            password=data.password
        )

        web.ctx.orm.add(user)
        web.ctx.orm.commit()
        if user.id and user.login() == 0:
            return web.seeother('/@'+user.username)

        return self.render('signup.html')