From ae6437047889e27d7edc5a0d53286b8583e2250d Mon Sep 17 00:00:00 2001 From: rumori Date: Wed, 20 Feb 2013 17:04:47 +0100 Subject: [PATCH] added option to disable register email --- flask_security/core.py | 1 + flask_security/registerable.py | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/flask_security/core.py b/flask_security/core.py index 3f2008a..c05ddaa 100644 --- a/flask_security/core.py +++ b/flask_security/core.py @@ -56,6 +56,7 @@ _default_config = { 'TRACKABLE': False, 'PASSWORDLESS': False, 'CHANGEABLE': False, + 'SEND_REGISTER_EMAIL': True, 'LOGIN_WITHIN': '1 days', 'CONFIRM_EMAIL_WITHIN': '5 days', 'RESET_PASSWORD_WITHIN': '5 days', diff --git a/flask_security/registerable.py b/flask_security/registerable.py index fc07574..4e9f357 100644 --- a/flask_security/registerable.py +++ b/flask_security/registerable.py @@ -36,7 +36,8 @@ def register_user(**kwargs): user_registered.send(dict(user=user, confirm_token=token), app=app._get_current_object()) - send_mail(config_value('EMAIL_SUBJECT_REGISTER'), user.email, 'welcome', - user=user, confirmation_link=confirmation_link) + if config_value('SEND_REGISTER_EMAIL'): + send_mail(config_value('EMAIL_SUBJECT_REGISTER'), user.email, 'welcome', + user=user, confirmation_link=confirmation_link) return user