Added more docstrings to forms and fields

This commit is contained in:
Antonio de la Rosa 2022-05-06 19:40:16 +02:00
parent 26dd863af8
commit d04a7121df
20 changed files with 79 additions and 9 deletions

View file

@ -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))