diff options
| author | Chris McDonough <chrism@plope.com> | 2016-09-14 16:09:42 -0400 |
|---|---|---|
| committer | Chris McDonough <chrism@plope.com> | 2016-09-14 16:09:42 -0400 |
| commit | 85bd2b8187c39e44285983261a74aa815f2b19ed (patch) | |
| tree | 4bc2269119fbe03d1fa54171148ff0cc5d88fd93 /docs/tutorials/wiki2/src/models | |
| parent | d350714a917b1a06dd4be6092e7b3da64771a4af (diff) | |
| parent | 4acd85dc98fb2a43eae54d2116cc4bf383157269 (diff) | |
| download | pyramid-85bd2b8187c39e44285983261a74aa815f2b19ed.tar.gz pyramid-85bd2b8187c39e44285983261a74aa815f2b19ed.tar.bz2 pyramid-85bd2b8187c39e44285983261a74aa815f2b19ed.zip | |
Merge branch 'master' of github.com:Pylons/pyramid
Diffstat (limited to 'docs/tutorials/wiki2/src/models')
| -rw-r--r-- | docs/tutorials/wiki2/src/models/tutorial/models/meta.py | 2 | ||||
| -rw-r--r-- | docs/tutorials/wiki2/src/models/tutorial/models/user.py | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/docs/tutorials/wiki2/src/models/tutorial/models/meta.py b/docs/tutorials/wiki2/src/models/tutorial/models/meta.py index fc3e8f1dd..0682247b5 100644 --- a/docs/tutorials/wiki2/src/models/tutorial/models/meta.py +++ b/docs/tutorials/wiki2/src/models/tutorial/models/meta.py @@ -3,7 +3,7 @@ from sqlalchemy.schema import MetaData # Recommended naming convention used by Alembic, as various different database # providers will autogenerate vastly different names making migrations more -# difficult. See: http://alembic.readthedocs.org/en/latest/naming.html +# difficult. See: http://alembic.zzzcomputing.com/en/latest/naming.html NAMING_CONVENTION = { "ix": 'ix_%(column_0_label)s', "uq": "uq_%(table_name)s_%(column_0_name)s", diff --git a/docs/tutorials/wiki2/src/models/tutorial/models/user.py b/docs/tutorials/wiki2/src/models/tutorial/models/user.py index 6fb32a1b2..9228b48f7 100644 --- a/docs/tutorials/wiki2/src/models/tutorial/models/user.py +++ b/docs/tutorials/wiki2/src/models/tutorial/models/user.py @@ -19,11 +19,10 @@ class User(Base): def set_password(self, pw): pwhash = bcrypt.hashpw(pw.encode('utf8'), bcrypt.gensalt()) - self.password_hash = pwhash + self.password_hash = pwhash.decode('utf8') def check_password(self, pw): if self.password_hash is not None: expected_hash = self.password_hash.encode('utf8') - actual_hash = bcrypt.hashpw(pw.encode('utf8'), expected_hash) - return expected_hash == actual_hash + return bcrypt.checkpw(pw.encode('utf8'), expected_hash) return False |
