def POST(self): u = self.argument('u') p = self.argument('p') uid = uid_by_email(u) if passwd_verify(uid, p): self.login(uid) return self.redirect('/me')
def account_new(email, passwd, name): email = email.lower() if uid_by_email(email): return uid = uid_new() email_save(uid, email) passwd_save(uid, passwd) profile_new(uid, name=name) return uid