def register(): if request.method == 'POST': Last_Name = request.form["Name"] First_Name = request.form["Fname"] Password = request.form["Pword"] Email = request.form["email"] Relationship = request.form["relatiestatus"] Sex = request.form["geslacht"] Bday = request.form["Birthday"] Route_visible = request.form["Route_visible"] Pictures_visible = request.form["Pics_visible"] control = Register_controller() user = control.GetRegisterData(Last_Name,First_Name,Password,Email,Relationship,Sex,Bday,Route_visible,Pictures_visible) if control.Check_Name(user) == False: return "Naam is reeds geregistreerd" elif control.Check_Email(user) == False: return "E-mail is reeds geregistreerd" else: control.register(user) return redirect('/index') else: logo = url_for('static', filename = 'NightBird.png') return render_template('Validator.html',logo = url_for('static', filename = 'NightBird.png'))
def do_POST(self): if self.path == "/send": form = cgi.FieldStorage( fp=self.rfile, headers=self.headers, environ={"REQUEST_METHOD": "POST", "CONTENT_TYPE": self.headers["Content-Type"]}, ) Last_Name = form["Name"].value First_Name = form["Fname"].value Password = form["Pword"].value Email = form["email"].value Relationship = form["relatiestatus"].value Sex = form["geslacht"].value Bday = form["Birthday"].value Route_visible = form["Route_visible"].value Pictures_visible = form["Pics_visible"].value print Last_Name print First_Name print Password print Email print Relationship print Sex print Bday print Route_visible print Pictures_visible control = Register_controller() user = control.GetRegisterData( Last_Name, First_Name, Password, Email, Relationship, Sex, Bday, Route_visible, Pictures_visible ) if control.Check_Name(user) == False: self.wfile.write("Naam is reeds geregistreerd") elif control.Check_Email(user) == False: self.wfile.write("E-mail is reeds geregistreerd") else: control.register(user) self.wfile.write("Bedankt voor u registratie") self.send_response(200) self.end_headers() return