def GET(self): """ """ if self.env["cfg"].enableRequests: view = requestsRequestTmpl(searchList=[self.tmplSearchList]) return view else: self._404()
def POST(self): """ """ if self.env["cfg"].enableRequests: email = self.env["members"]["email"] if self.env["members"].has_key("email") else "" found = um.userORM.find(email) or rm.requestORM.find(email) if email and not found: newRequest = rm.requestORM(email) newRequest.save() self.head = ("303 SEE OTHER", [("location", "/request/thanks")]) self.session.pushAlert( "Thanks, %s for registering. \ We hope to get you an invite soon!" % email, "", "success", ) else: if found: self.session.pushAlert( "There is already someone in our \ system with that email! If this is a mistake and \ you have not requested an invite or registered \ before, please send us an email \ at: [email protected]", "Wha'oh", "error", ) view = requestsRequestTmpl(searchList=[self.tmplSearchList]) view.emailError = True return view else: self._404()