def validate_password(self, field): user = getuser(email=self.email.data) if not user: return password = utils.string_hash(field.data, self.email.data) if password != user.password: raise ValidationError(u'Password error.')
def hash_password(self, password): return string_hash(password, salt = self.email)
def hash_password(self, password): return string_hash(password, salt=self.email)
def __init__(self, name, email, password): self.name = escape(name) self.email = escape(email) self.password = string_hash(password, salt = self.email) self.created = datetime.datetime.now()