Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions source/users.rst
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,8 @@ before being stored.
return self._password

@password.setter
def _set_password(self, plaintext):
self._password = bcrypt.generate_password_hash(plaintext)
def password(self, plaintext):
self._password = bcrypt.generate_password_hash(plaintext).decode("utf-8")

We're using SQLAlchemy's hybrid extension to define a property with
several different functions called from the same interface. Our setter
Expand Down Expand Up @@ -337,7 +337,7 @@ the hashed password stored for that user.

# [...] columns and properties

def is_correct_password(self, plaintext)
def is_correct_password(self, plaintext):
return bcrypt.check_password_hash(self._password, plaintext)


Expand Down