summaryrefslogtreecommitdiff
path: root/docs/tutorials/wiki2/src/authorization
diff options
context:
space:
mode:
Diffstat (limited to 'docs/tutorials/wiki2/src/authorization')
-rw-r--r--docs/tutorials/wiki2/src/authorization/tutorial/models/page.py2
-rw-r--r--docs/tutorials/wiki2/src/authorization/tutorial/models/user.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/docs/tutorials/wiki2/src/authorization/tutorial/models/page.py b/docs/tutorials/wiki2/src/authorization/tutorial/models/page.py
index 4dd5b5721..74ff1faf8 100644
--- a/docs/tutorials/wiki2/src/authorization/tutorial/models/page.py
+++ b/docs/tutorials/wiki2/src/authorization/tutorial/models/page.py
@@ -14,7 +14,7 @@ class Page(Base):
__tablename__ = 'pages'
id = Column(Integer, primary_key=True)
name = Column(Text, nullable=False, unique=True)
- data = Column(Integer, nullable=False)
+ data = Column(Text, nullable=False)
creator_id = Column(ForeignKey('users.id'), nullable=False)
creator = relationship('User', backref='created_pages')
diff --git a/docs/tutorials/wiki2/src/authorization/tutorial/models/user.py b/docs/tutorials/wiki2/src/authorization/tutorial/models/user.py
index 6bd3315d6..6fb32a1b2 100644
--- a/docs/tutorials/wiki2/src/authorization/tutorial/models/user.py
+++ b/docs/tutorials/wiki2/src/authorization/tutorial/models/user.py
@@ -23,7 +23,7 @@ class User(Base):
def check_password(self, pw):
if self.password_hash is not None:
- expected_hash = self.password_hash
+ expected_hash = self.password_hash.encode('utf8')
actual_hash = bcrypt.hashpw(pw.encode('utf8'), expected_hash)
return expected_hash == actual_hash
return False