From 0be2e96b61606e2a702d3e4fedc612383b20eafd Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 9 Apr 2016 02:55:34 -0700 Subject: - remove accidentally committed file --- pyramidtut/tutorial/tutorial/models/user.py | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 pyramidtut/tutorial/tutorial/models/user.py diff --git a/pyramidtut/tutorial/tutorial/models/user.py b/pyramidtut/tutorial/tutorial/models/user.py deleted file mode 100644 index a835deb01..000000000 --- a/pyramidtut/tutorial/tutorial/models/user.py +++ /dev/null @@ -1,29 +0,0 @@ -import bcrypt -from sqlalchemy import ( - Column, - Integer, - Text, -) - -from tutorial.tutorial.models.meta import Base - - -class User(Base): - """ The SQLAlchemy declarative model class for a User object. """ - __tablename__ = 'users' - id = Column(Integer, primary_key=True) - name = Column(Text, nullable=False, unique=True) - role = Column(Text, nullable=False) - - password_hash = Column(Text) - - def set_password(self, pw): - pwhash = bcrypt.hashpw(pw.encode('utf8'), bcrypt.gensalt()) - self.password_hash = pwhash - - def check_password(self, pw): - if self.password_hash is not None: - expected_hash = self.password_hash - actual_hash = bcrypt.hashpw(pw.encode('utf8'), expected_hash) - return expected_hash == actual_hash - return False -- cgit v1.2.3