mirror of
https://github.com/wassname/flask-security.git
synced 2026-07-14 01:10:34 +08:00
Add already confirmed scenario. Let datastore work without a request context
This commit is contained in:
+2
-1
@@ -19,6 +19,7 @@ from flask.ext.security.datastore import SQLAlchemyUserDatastore, \
|
||||
from flask.ext.security.decorators import http_auth_required, \
|
||||
auth_token_required
|
||||
from flask.ext.security.exceptions import RoleNotFoundError
|
||||
from flask.ext.security.utils import encrypt_password
|
||||
|
||||
|
||||
def create_roles():
|
||||
@@ -34,7 +35,7 @@ def create_users():
|
||||
('jill@lp.com', 'password', ['author'], True),
|
||||
('tiya@lp.com', 'password', [], False)):
|
||||
current_app.security.datastore.create_user(
|
||||
email=u[0], password=u[1], roles=u[2], active=u[3])
|
||||
email=u[0], password=encrypt_password(u[1]), roles=u[2], active=u[3])
|
||||
current_app.security.datastore._commit()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user