def parse_email(self): email = self.request.get('email') passwd = self.request.get('passwd') if email and passwd: entity = Email.get_instance(email) if entity and entity.passwd == passwd and entity.registered == 1: return email if self.is_test_env() and email == '*****@*****.**': return email return None
def handle_login(self): email = self.email if not email: email = self.request.get('email') if not email: return False entity = Email.get_instance(email) if entity.registered: return False, 'password is wrong' return False, "%s hasn't been registered" % email return True, email