Fix quoting in docstring.
This commit is contained in:
parent
0a6f7e3c2e
commit
f51f238be7
@ -28,7 +28,7 @@ from . import db
|
||||
|
||||
|
||||
class User(UserMixin, db.Model):
|
||||
"Class used to handle users."
|
||||
"""Class used to handle users."""
|
||||
# pylint: disable=invalid-name
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
email = db.Column(db.String(200), nullable=False, unique=True, index=True)
|
||||
@ -41,27 +41,27 @@ class User(UserMixin, db.Model):
|
||||
|
||||
@classmethod
|
||||
def query(cls):
|
||||
"Return a query for this class."
|
||||
"""Return a query for this class."""
|
||||
return db.session.query(cls)
|
||||
|
||||
@classmethod
|
||||
def hash_password(cls, password):
|
||||
"Password hash function."
|
||||
"""Password hash function."""
|
||||
return crypt.encrypt(password)
|
||||
|
||||
def verify_password(self, password):
|
||||
"Verify password passed in argument with the user's one."
|
||||
"""Verify password passed in argument with the user's one."""
|
||||
return crypt.verify(password, self.password)
|
||||
|
||||
def generate_auth_token(self):
|
||||
"Generate authentication token used to identify the session."
|
||||
"""Generate authentication token used to identify the session."""
|
||||
serializer = Serializer(app.secret_key)
|
||||
|
||||
return serializer.dumps({'id': self.id})
|
||||
|
||||
@classmethod
|
||||
def verify_auth_token(cls, token):
|
||||
"Verify the authentication token and return the associated user."
|
||||
"""Verify the authentication token and return the associated user."""
|
||||
serializer = Serializer(app.config['SECRET_KEY'])
|
||||
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user