Add already confirmed scenario. Let datastore work without a request context

This commit is contained in:
Matt Wright
2012-08-21 01:50:40 -04:00
parent f2d5028d7c
commit 828a973339
6 changed files with 29 additions and 13 deletions
+3 -1
View File
@@ -75,6 +75,7 @@ _default_messages = {
'EMAIL_CONFIRMED': ('Thank you. Your email has been confirmed.', 'success'),
'ALREADY_CONFIRMED': ('Your email has already been confirmed.', 'info'),
'INVALID_CONFIRMATION_TOKEN': ('Invalid confirmation token.', 'error'),
'ALREADY_CONFIRMED': ('This email has already been confirmed', 'info'),
'PASSWORD_RESET_REQUEST': ('Instructions to reset your password have been sent to %(email)s.', 'info'),
'PASSWORD_RESET_EXPIRED': ('You did not reset your password within %(within)s. New instructions have been sent to %(email)s.', 'error'),
'INVALID_RESET_PASSWORD_TOKEN': ('Invalid reset password token.', 'error'),
@@ -273,6 +274,7 @@ class Security(object):
:param app: The application.
:param datastore: An instance of a user datastore.
"""
datastore = datastore or self.datastore
for key, value in _default_config.items():
app.config.setdefault('SECURITY_' + key, value)
@@ -290,7 +292,7 @@ class Security(object):
template_folder='templates')
app.register_blueprint(bp)
state = self._get_state(app, datastore or self.datastore)
state = self._get_state(app, datastore)
app.extensions['security'] = state