summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Merickel <mmerickel@users.noreply.github.com>2016-05-18 21:38:37 -0500
committerMichael Merickel <mmerickel@users.noreply.github.com>2016-05-18 21:38:37 -0500
commitdfdcf1b3e961f735f30c6e3efe47c303523660f0 (patch)
tree3502674da404e337c491812e7990bd72bf7befbb
parent86cf088aea33b6e27b7b05fc904c403363245ae5 (diff)
parent5b73bd4fce3f00fef581940ca6ca972576c03094 (diff)
downloadpyramid-dfdcf1b3e961f735f30c6e3efe47c303523660f0.tar.gz
pyramid-dfdcf1b3e961f735f30c6e3efe47c303523660f0.tar.bz2
pyramid-dfdcf1b3e961f735f30c6e3efe47c303523660f0.zip
Merge pull request #2576 from mmerickel/fix/unicode-password-hash
password_hash is unicode, needs to be encoded
-rw-r--r--docs/tutorials/wiki2/src/authentication/tutorial/models/user.py2
-rw-r--r--docs/tutorials/wiki2/src/models/tutorial/models/user.py2
-rw-r--r--docs/tutorials/wiki2/src/tests/tutorial/models/user.py2
-rw-r--r--docs/tutorials/wiki2/src/views/tutorial/models/user.py2
4 files changed, 4 insertions, 4 deletions
diff --git a/docs/tutorials/wiki2/src/authentication/tutorial/models/user.py b/docs/tutorials/wiki2/src/authentication/tutorial/models/user.py
index 6bd3315d6..6fb32a1b2 100644
--- a/docs/tutorials/wiki2/src/authentication/tutorial/models/user.py
+++ b/docs/tutorials/wiki2/src/authentication/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
diff --git a/docs/tutorials/wiki2/src/models/tutorial/models/user.py b/docs/tutorials/wiki2/src/models/tutorial/models/user.py
index 6bd3315d6..6fb32a1b2 100644
--- a/docs/tutorials/wiki2/src/models/tutorial/models/user.py
+++ b/docs/tutorials/wiki2/src/models/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
diff --git a/docs/tutorials/wiki2/src/tests/tutorial/models/user.py b/docs/tutorials/wiki2/src/tests/tutorial/models/user.py
index 6bd3315d6..6fb32a1b2 100644
--- a/docs/tutorials/wiki2/src/tests/tutorial/models/user.py
+++ b/docs/tutorials/wiki2/src/tests/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
diff --git a/docs/tutorials/wiki2/src/views/tutorial/models/user.py b/docs/tutorials/wiki2/src/views/tutorial/models/user.py
index 6bd3315d6..6fb32a1b2 100644
--- a/docs/tutorials/wiki2/src/views/tutorial/models/user.py
+++ b/docs/tutorials/wiki2/src/views/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