Пример #1
0
    def post(self):
        username = self.request.get('username')
        password = self.request.get('password')

        u = User.login(username, password)
        if u:
            self.login(u)
            self.redirect('/blog/welcome/?')
        else:
            msg = 'Invalid login'
            self.render('login-form.html', error=msg)
Пример #2
0
 def post(self):
     username = self.request.get('username')
     password = self.request.get('password')
     
     u = User.login(username, password)
     if u:
         self.login(u)
         self.redirect('/blog/welcome/?')
     else:
         msg = 'Invalid login'
         self.render('login-form.html', error = msg)
Пример #3
0
 def post(self):
     username = self.request.get('username')
     password = self.request.get('password')
     
     u = User.login(username, password)
     if u:
         self.login(u)
         self.redirect('/')
     else:
         msg = 'Invalid login'
         self.params['msg'] = msg
         self.render('login-form.html')
Пример #4
0
    def post(self):
        username = self.request.get('username')
        password = self.request.get('password')

        u = User.login(username, password)
        if u:
            self.login(u)
            self.redirect('/')
        else:
            msg = 'Invalid login'
            self.params['msg'] = msg
            self.render('login-form.html')
Пример #5
0
    def post(self):
        username = self.request.get('username')
        password = self.request.get('password')

        self.next_url = str(self.request.get('next_url'))
        if not self.next_url or self.next_url.startswith('/login'):
            self.next_url = '/'

        u = User.login(username, password)
        if u:
            self.login(u)
            self.done()
        else:
            msg = 'Invalid login'
            self.render('login-form.html', error = msg)