From 2e5a241777ef0bb0d76420d39bf3be41e16e042a Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Thu, 18 Feb 2016 08:59:13 +0100 Subject: New management of the token for the account confirmation. --- src/web/models/__init__.py | 2 +- src/web/models/user.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'src/web/models') diff --git a/src/web/models/__init__.py b/src/web/models/__init__.py index e6615ab4..d9489dbb 100644 --- a/src/web/models/__init__.py +++ b/src/web/models/__init__.py @@ -96,7 +96,7 @@ def db_create(db): "root@jarr.localhost"), pwdhash=generate_password_hash( os.environ.get("ADMIN_PASSWORD", "password")), - activation_key="") + enabled=True) user1.roles.extend([role_admin, role_user]) db.session.add(user1) diff --git a/src/web/models/user.py b/src/web/models/user.py index cdbfb457..1a276f7e 100644 --- a/src/web/models/user.py +++ b/src/web/models/user.py @@ -45,8 +45,7 @@ class User(db.Model, UserMixin): email = db.Column(db.String(254), index=True, unique=True) pwdhash = db.Column(db.String()) roles = db.relationship('Role', backref='user', lazy='dynamic') - activation_key = db.Column(db.String(128), default=hashlib.sha512( - str(random.getrandbits(256)).encode("utf-8")).hexdigest()[:86]) + enabled = db.Column(db.Boolean(), default=False) date_created = db.Column(db.DateTime(), default=datetime.now) last_seen = db.Column(db.DateTime(), default=datetime.now) feeds = db.relationship('Feed', backref='subscriber', lazy='dynamic', -- cgit