From 217ecca74413a4460c166e1f3e1b608503a26a40 Mon Sep 17 00:00:00 2001 From: iou1name Date: Sat, 21 Nov 2020 14:27:33 -0500 Subject: [PATCH] prevent duplicate account creation --- stickup.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/stickup.py b/stickup.py index 2b9d8ac..9f7b855 100755 --- a/stickup.py +++ b/stickup.py @@ -41,6 +41,12 @@ async def index(request): if form_type == 'change_password': result = await forms.change_password(request, user_data) elif form_type == 'new_email': + if user_data: + result = { + 'ok': False, + 'message': "You already have an email account." + } + return render_template('index.html', request, locals()) result = await forms.new_email(request) if result['ok']: email = request['meta']['username'] + '@' +config.server_domain