Example #1
0
 def post(self):
     username = self.request.get('username')
     password = self.request.get('password')
     
     user = User.login(username, password)
     if user:
         self.set_login_cookie(user)
         self.redirect('/wiki/welcome')
     else:
         self.render('login.html',
                     error="Incorrect username or password.",
                     username = username)
Example #2
0
 def get_author(self):
     user = User.get_by_id(self.author_id)
     return user.username