about summary refs log tree commit diff
diff options
context:
space:
mode:
authorzsloan2020-09-22 16:47:24 -0500
committerzsloan2020-09-22 16:47:24 -0500
commit00cefa3d42c3e2b6633573eb124e1bcf68cea7ab (patch)
tree33ad99b56159be04d9fc4f03833e395071df6736
parentf887ee8ca60d5c18c394b04a9bc5a9341da95327 (diff)
downloadgenenetwork2-00cefa3d42c3e2b6633573eb124e1bcf68cea7ab.tar.gz
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
-rw-r--r--wqflask/wqflask/user_login.py4
1 files changed, 3 insertions, 1 deletions
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