summaryrefslogtreecommitdiffstats
path: root/flaskapp.py
diff options
context:
space:
mode:
Diffstat (limited to 'flaskapp.py')
-rw-r--r--flaskapp.py27
1 files changed, 15 insertions, 12 deletions
diff --git a/flaskapp.py b/flaskapp.py
index cfa21e8..c8ce2d3 100644
--- a/flaskapp.py
+++ b/flaskapp.py
@@ -11,14 +11,15 @@ app.config['SECRET_KEY'] = '$secret' #remove later
def hello():
return render_template('home.html')
+#@app.route('/kiwi')
+#def kiwi():
+# return redirect("https://liberta.casa/kiwi/")
@app.route('/kiwi')
-def kiwi():
- return redirect("https://liberta.casa/kiwi/")
-@app.route('/kiwi/')
-def kiwinick(nick, show_password_box):
+def kiwinick():
nick = request.args.get('nick', None)
- show_password_box = requests.args.get('show_password_box', None)
- return redirect("https://liberta.casa/kiwi/")
+ show_password_box = request.args.get('show_password_box', None)
+ redirect_url = 'https://liberta.casa/kiwi/'+'?nick='+nick+'&show_password_box'+'='+show_password_box
+ return redirect(redirect_url)
@app.route('/register', methods=['GET', 'POST'])
def register():
@@ -30,14 +31,16 @@ def register():
password = request.form.get('password')
# email = request.form.get('email') add password arg to ircregisterfunction
response = ircregister(username, password, email)
- if response == "server failure":
- flash("Server Unavailable")
- elif response == "433":
- flash("Username already taken. Please select a different username")
+ if response == "433":
+ flash("IRC username already taken. Please select a different username")
+ elif response == "409":
+ flash("User already exists.")
elif response == "success":
return redirect(url_for('kiwinick', nick=username, show_password_box='true'))
- elif response == "failure":
- flash("Failure! Please try after some time or use NickServ.")
+ elif response == "invalidemail":
+ flash("Is that a valid email address?")
+ elif response == "ssoerr":
+ flash("Sorry, we messed up. Please contact an administrator.")
return render_template('register.html', title='Register', form=form)