diff options
| author | Michael Merickel <michael@merickel.org> | 2016-05-15 23:11:29 -0500 |
|---|---|---|
| committer | Michael Merickel <michael@merickel.org> | 2016-05-15 23:11:29 -0500 |
| commit | 5b73bd4fce3f00fef581940ca6ca972576c03094 (patch) | |
| tree | 2673f72ff68aeddf34852e08a6edb787f530bed4 /docs/tutorials/wiki2/src/models | |
| parent | 7a2117fad97dc4a896caa6e98fe1b37bbea3b531 (diff) | |
| download | pyramid-5b73bd4fce3f00fef581940ca6ca972576c03094.tar.gz pyramid-5b73bd4fce3f00fef581940ca6ca972576c03094.tar.bz2 pyramid-5b73bd4fce3f00fef581940ca6ca972576c03094.zip | |
password_hash is unicode, needs to be encoded
Diffstat (limited to 'docs/tutorials/wiki2/src/models')
| -rw-r--r-- | docs/tutorials/wiki2/src/models/tutorial/models/user.py | 2 |
1 files changed, 1 insertions, 1 deletions
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 |
