def post(self): user_username = self.request.get('username') user_password = self.request.get('password') user_verify = self.request.get('verify') user_email = self.request.get('email') cgi_username = valid_text(user_username) cgi_password = valid_text(user_password) cgi_verify = valid_text(user_verify) cgi_email = valid_text(user_email) username_error = "" password_error = "" verify_error = "" email_error = "" error = False if not valid_username(user_username): username_error = "Need name!" error = True if not valid_password(user_password): password_error = "Need password!" error = True if not user_verify or not user_password == user_verify: verify_error = "Need verification!" error = True if not valid_email(user_email): email_error = "Need email!" error = True if error: cgi_password = "" cgi_verify = "" self.write_form(cgi_username, cgi_password, cgi_verify, cgi_email, username_error, password_error, verify_error, email_error) else: self.redirect("/welcome?username=%s" % user_username)
def post(self): user_text = self.request.get('text') rot13 = rot_text(user_text) text = valid_text(rot13) self.write_form(text)