From 00cefa3d42c3e2b6633573eb124e1bcf68cea7ab Mon Sep 17 00:00:00 2001 From: zsloan Date: Tue, 22 Sep 2020 16:47:24 -0500 Subject: Fixed a pretty big mistake where user accounts would be saved even when there was some mistake/error during registration * wqflask/wqflask/user_login.py - Previously it would still save a user even if there was some problem like their e-mail already being associated with an account. It would display the error, but still run save_user. I fixed this so that it no longer saves the user if there are any errors --- wqflask/wqflask/user_login.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'wqflask') diff --git a/wqflask/wqflask/user_login.py b/wqflask/wqflask/user_login.py index 9331f369..077a799b 100644 --- a/wqflask/wqflask/user_login.py +++ b/wqflask/wqflask/user_login.py @@ -453,7 +453,9 @@ def register_user(params): user_details['confirmed'] = 1 user_details['registration_info'] = basic_info() - save_user(user_details, user_details['user_id']) + + if len(errors) == 0: + save_user(user_details, user_details['user_id']) return errors -- cgit v1.2.3