aboutsummaryrefslogtreecommitdiff
path: root/app/auth
diff options
context:
space:
mode:
authorGertjan van den Burg <gertjanvandenburg@gmail.com>2019-04-01 15:58:14 +0100
committerGertjan van den Burg <gertjanvandenburg@gmail.com>2019-04-01 15:58:14 +0100
commit47b38ea7f9e8c4e57d5463dc68271819b823d023 (patch)
tree54d073431e3da31a0184545fbf15b8e6cac1ab36 /app/auth
parentfetch d3 over https (diff)
downloadAnnotateChange-47b38ea7f9e8c4e57d5463dc68271819b823d023.tar.gz
AnnotateChange-47b38ea7f9e8c4e57d5463dc68271819b823d023.zip
Move task assignment to separate module
Also, add automatic assign on user signup
Diffstat (limited to 'app/auth')
-rw-r--r--app/auth/routes.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/auth/routes.py b/app/auth/routes.py
index c5c175c..73cbd6a 100644
--- a/app/auth/routes.py
+++ b/app/auth/routes.py
@@ -22,6 +22,7 @@ from app.auth.email import (
send_password_reset_email,
send_email_confirmation_email,
)
+from app.utils.tasks import create_initial_user_tasks
@bp.route("/login", methods=("GET", "POST"))
@@ -122,7 +123,13 @@ def confirm_email(token):
else:
user.is_confirmed = True
db.session.commit()
+ for task in create_initial_user_tasks(user):
+ if task is None:
+ break
+ db.session.add(task)
+ db.session.commit()
flash("Account confirmed successfully. Thank you!", "success")
+ return redirect(url_for("auth.login"))
return redirect(url_for("main.index"))