aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r/models.py
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2014-11-19 21:36:45 +0100
committerCédric Bonhomme <cedric@cedricbonhomme.org>2014-11-19 21:36:45 +0100
commite805a4eeab96d01fc24b7215bdef8c63a77e8934 (patch)
tree4e57d1ff887ff32cfdd0e29f1a3fa60e0dcec450 /pyaggr3g470r/models.py
parentEmails via Postmark and traditional SMTP server. (diff)
downloadnewspipe-e805a4eeab96d01fc24b7215bdef8c63a77e8934.tar.gz
newspipe-e805a4eeab96d01fc24b7215bdef8c63a77e8934.tar.bz2
newspipe-e805a4eeab96d01fc24b7215bdef8c63a77e8934.zip
Bug fix: activation key was too long for the database column.
Diffstat (limited to 'pyaggr3g470r/models.py')
-rw-r--r--pyaggr3g470r/models.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/pyaggr3g470r/models.py b/pyaggr3g470r/models.py
index 3e3f76d4..f7052ed5 100644
--- a/pyaggr3g470r/models.py
+++ b/pyaggr3g470r/models.py
@@ -45,10 +45,10 @@ 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(86), default =
+ activation_key = db.Column(db.String(128), default =
hashlib.sha512(
str(random.getrandbits(256)).encode("utf-8")
- ).hexdigest())
+ ).hexdigest()[:86])
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', cascade='all,delete-orphan')
bgstack15