示例#1
0
文件: forms.py 项目: btwo/hanger
 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.')
示例#2
0
 def hash_password(self, password):
     return string_hash(password, salt = self.email)
示例#3
0
文件: model.py 项目: zwxsky/hanger
 def hash_password(self, password):
     return string_hash(password, salt=self.email)
示例#4
0
 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()