|
|
|
@ -20,7 +20,7 @@ import arrow
|
|
|
|
|
from functools import wraps |
|
|
|
|
|
|
|
|
|
from flask_security import current_user |
|
|
|
|
from flask_security.utils import encrypt_password |
|
|
|
|
from flask_security.utils import hash_password |
|
|
|
|
from sqlalchemy import exc |
|
|
|
|
from wtforms.validators import Email |
|
|
|
|
from wtforms.validators import ValidationError |
|
|
|
@ -105,12 +105,12 @@ def add_user(email, password, roles, admin_first_run=False):
|
|
|
|
|
fullname = email.split("@")[0] |
|
|
|
|
if admin_first_run: |
|
|
|
|
user_datastore.create_user(email=email, |
|
|
|
|
password=encrypt_password(password), |
|
|
|
|
password=hash_password(password), |
|
|
|
|
fullname=fullname, |
|
|
|
|
confirmed_at=arrow.utcnow()) |
|
|
|
|
else: |
|
|
|
|
user_datastore.create_user(email=email, |
|
|
|
|
password=encrypt_password(password), |
|
|
|
|
password=hash_password(password), |
|
|
|
|
fullname=fullname) |
|
|
|
|
|
|
|
|
|
try: |
|
|
|
|