Added more docstrings to forms and fields
This commit is contained in:
parent
26dd863af8
commit
d04a7121df
20 changed files with 79 additions and 9 deletions
|
|
@ -4,6 +4,7 @@ from hmac import compare_digest as compare_hash
|
|||
import crypt
|
||||
|
||||
class PasswordField(PhangoField):
|
||||
"""Field for check and save passwords"""
|
||||
|
||||
def __init__(self, name, size=1024, required=False):
|
||||
|
||||
|
|
@ -57,6 +58,7 @@ class PasswordField(PhangoField):
|
|||
|
||||
@staticmethod
|
||||
def verify( password, h):
|
||||
"""Static method used for verify a password save using PasswordField"""
|
||||
#return bcrypt_sha256.verify(password, h)
|
||||
return compare_hash(h, crypt.crypt(password, h))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue