def validate(email, password, username): message = "\n".join([ validate_email_str(email), validate_password_str(password), validate_publicname_str(username) ]).rstrip() return message
def set_password_cleartext(self, cleartext): message = validate_password_str(cleartext) if message: raise Exception("Invalid password: %s" % message) """Set 'self.password' to the digest of 'cleartext'.""" self.password = new_secure_hash(text_type=cleartext)