Fix quoting in docstring.

This commit is contained in:
Alexis Lahouze 2017-05-07 22:40:06 +02:00
parent 0a6f7e3c2e
commit f51f238be7

View File

@ -28,7 +28,7 @@ from . import db
class User(UserMixin, db.Model): class User(UserMixin, db.Model):
"Class used to handle users." """Class used to handle users."""
# pylint: disable=invalid-name # pylint: disable=invalid-name
id = db.Column(db.Integer, primary_key=True) id = db.Column(db.Integer, primary_key=True)
email = db.Column(db.String(200), nullable=False, unique=True, index=True) email = db.Column(db.String(200), nullable=False, unique=True, index=True)
@ -41,27 +41,27 @@ class User(UserMixin, db.Model):
@classmethod @classmethod
def query(cls): def query(cls):
"Return a query for this class." """Return a query for this class."""
return db.session.query(cls) return db.session.query(cls)
@classmethod @classmethod
def hash_password(cls, password): def hash_password(cls, password):
"Password hash function." """Password hash function."""
return crypt.encrypt(password) return crypt.encrypt(password)
def verify_password(self, 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) return crypt.verify(password, self.password)
def generate_auth_token(self): 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) serializer = Serializer(app.secret_key)
return serializer.dumps({'id': self.id}) return serializer.dumps({'id': self.id})
@classmethod @classmethod
def verify_auth_token(cls, token): 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']) serializer = Serializer(app.config['SECRET_KEY'])
try: try: