diff options
author | François Schmidts <francois.schmidts@gmail.com> | 2016-02-02 23:15:37 +0100 |
---|---|---|
committer | François Schmidts <francois.schmidts@gmail.com> | 2016-02-02 23:15:37 +0100 |
commit | 082bf39a7dd7296d4f51b6b124d185135dc00989 (patch) | |
tree | 6e12cf2b67b016aff38874c389b5bf8b5242749a /src/web/models/user.py | |
parent | fixing logging (diff) | |
parent | reload and fold all button (diff) | |
download | newspipe-082bf39a7dd7296d4f51b6b124d185135dc00989.tar.gz newspipe-082bf39a7dd7296d4f51b6b124d185135dc00989.tar.bz2 newspipe-082bf39a7dd7296d4f51b6b124d185135dc00989.zip |
Merge branch 'feature/categories'
close #22
close #23
Diffstat (limited to 'src/web/models/user.py')
-rw-r--r-- | src/web/models/user.py | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/web/models/user.py b/src/web/models/user.py index c5e70036..d1b9c568 100644 --- a/src/web/models/user.py +++ b/src/web/models/user.py @@ -30,7 +30,7 @@ import re import random import hashlib from datetime import datetime -from werkzeug import generate_password_hash, check_password_hash +from werkzeug import check_password_hash from flask.ext.login import UserMixin from bootstrap import db @@ -63,12 +63,6 @@ class User(db.Model, UserMixin): """ return self.id - def set_password(self, password): - """ - Hash the password of the user. - """ - self.pwdhash = generate_password_hash(password) - def check_password(self, password): """ Check the password of the user. @@ -79,7 +73,7 @@ class User(db.Model, UserMixin): """ Return True if the user has administrator rights. """ - return len([role for role in self.roles if role.name == "admin"]) != 0 + return "admin" in [role.name for role in self.roles] def __eq__(self, other): return self.id == other.id |