Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix identical problem with app as with datastore
  • Loading branch information
abendebury committed Aug 4, 2016
1 parent ee4d66b commit 3701b91
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
7 changes: 3 additions & 4 deletions flask_security/core.py
Expand Up @@ -413,9 +413,8 @@ def init_app(self, app, datastore=None, register_blueprint=True,
:param datastore: An instance of a user datastore.
:param register_blueprint: to register the Security blueprint or not.
"""
if not self.datastore:
self.datastore = datastore
datastore = self.datastore
self.app = app
self.datastore = datastore

for key, value in _default_config.items():
app.config.setdefault('SECURITY_' + key, value)
Expand All @@ -425,7 +424,7 @@ def init_app(self, app, datastore=None, register_blueprint=True,

identity_loaded.connect_via(app)(_on_identity_loaded)

state = _get_state(app, datastore,
state = _get_state(app, self.datastore,
login_form=login_form,
confirm_register_form=confirm_register_form,
register_form=register_form,
Expand Down
1 change: 1 addition & 0 deletions tests/test_datastore.py
Expand Up @@ -159,3 +159,4 @@ def test_access_datastore_from_factory(app, datastore):
security.init_app(app, datastore)

assert security.datastore is not None
assert security.app is not None

0 comments on commit 3701b91

Please sign in to comment.