aboutsummaryrefslogtreecommitdiff
path: root/src/web/views
diff options
context:
space:
mode:
Diffstat (limited to 'src/web/views')
-rw-r--r--src/web/views/session_mgmt.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/web/views/session_mgmt.py b/src/web/views/session_mgmt.py
index 5e67513a..dc80516a 100644
--- a/src/web/views/session_mgmt.py
+++ b/src/web/views/session_mgmt.py
@@ -16,6 +16,7 @@ import conf
from web.views.common import admin_role, api_role, login_user_bundle
from web.controllers import UserController
from web.forms import SignupForm, SigninForm
+from web import notifications
Principal(current_app)
# Create a permission with a single Need, in this case a RoleNeed.
@@ -88,7 +89,18 @@ def signup():
user = UserController().create(nickname=form.nickname.data,
email=form.email.data,
pwdhash=generate_password_hash(form.password.data))
- login_user_bundle(user)
+
+ # Send the confirmation email
+ try:
+ notifications.new_account_notification(user)
+ except Exception as error:
+ flash(gettext('Problem while sending activation email: %(error)s',
+ error=error), 'danger')
+ return redirect(url_for('home'))
+
+ flash(gettext('Your account has been created. '
+ 'Check your mail to confirm it.'), 'success')
+
return redirect(url_for('home'))
return render_template('signup.html', form=form)
bgstack15