From d5f5ac7bd254ac591b4bbeb606565ac22e2ce35c Mon Sep 17 00:00:00 2001 From: Georg Date: Thu, 2 Sep 2021 01:47:37 +0200 Subject: Savepoint Signed-off-by: Georg --- flaskapp.py | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) (limited to 'flaskapp.py') diff --git a/flaskapp.py b/flaskapp.py index c8ce2d3..440b407 100644 --- a/flaskapp.py +++ b/flaskapp.py @@ -1,5 +1,5 @@ from flask import Flask, render_template, url_for, request, redirect, flash -from forms import RegistrationForm +from forms import RegistrationForm, OptionForm from irc_register import ircregister #from irc_verify import ircverify @@ -23,13 +23,30 @@ def kiwinick(): @app.route('/register', methods=['GET', 'POST']) def register(): - form = RegistrationForm() - if request.method == 'POST': + optionform = OptionForm() + registerform = RegistrationForm() + if optionform.validate_on_submit(): + option = request.form['options'] + print(option) + print(form.option.data) + if option == 'mail-old': + return "", 200 + #return "", 200 + elif option == 'mail-new': + return "", 200 + + return render_template('register.html', title='Register', optionform=optionform, registerform=registerform) +@app.route('/register1', methods=['GET', 'POST']) +def register1(): + optionform = OptionForm() + registerform = RegistrationForm() + if request.method == 'POST': username = request.form.get('username') email = request.form.get('email') password = request.form.get('password') -# email = request.form.get('email') add password arg to ircregisterfunction + option = request.form['options'] + print(option) response = ircregister(username, password, email) if response == "433": flash("IRC username already taken. Please select a different username") @@ -42,7 +59,8 @@ def register(): elif response == "ssoerr": flash("Sorry, we messed up. Please contact an administrator.") - return render_template('register.html', title='Register', form=form) + return render_template('register1.html', title='Register', optionform=optionform, registerform=registerform) + #@app.route('/verify', methods=['GET', 'POST']) #def verify(): -- cgit v1.2.3