def POST(self): i = web.input() sf, wf = forms.signupform(), forms.wyrform() if not sf.validates(i): lf, pf = forms.loginform(), forms.petitionform() sf.fill(i), pf.fill(i), wf.fill(i) return render.petitionlogin(lf, sf, pf, wf) user = auth.new_user(i.email, i.password) helpers.set_login_cookie(i.email) create_petition(i, i.email) raise web.seeother("/%s" % i.pid)
def POST(self): i = web.input() sf, wf = forms.signupform(), forms.wyrform() if not sf.validates(i): lf, pf = forms.loginform(), forms.petitionform() sf.fill(i), pf.fill(i), wf.fill(i) return render.petitionlogin(lf, sf, pf, wf) user = auth.new_user(i.email, i.password) helpers.set_login_cookie(i.email) create_petition(i, i.email) raise web.seeother('/%s' % i.pid)
def POST(self): p = web.input() pform = forms.petitionform() auth.assert_verified(p.email) if pform.validates(p): save_petition(p) helpers.set_login_cookie(p.email) msg = """Congratulations, you've created your petition. Now sign and share it with all your friends.""" helpers.set_msg(msg) return web.seeother('/%s' % p.pid) else: return render.petitionform(pform)
def POST(self): i = web.input() sf, wf = forms.signupform(), forms.wyrform() if not sf.validates(i): lf, pf = forms.loginform(), forms.petitionform() sf.fill(i), pf.fill(i), wf.fill(i) return render.petitionlogin(lf, sf, pf, wf) user = auth.new_user(i.email, i.password) helpers.set_login_cookie(i.email) try: create_petition(i, i.email, wf) except CaptchaException: msg, msg_type = helpers.get_delete_msg() pf = forms.petitionform() pf.fill(i) return render.petitionform(pf, wf, msg) raise web.seeother('/%s' % i.pid)