Esempio n. 1
0
File: models.py Progetto: unk2k/mage
 def by_credential(cls, env, login, password):
     try:
         user = env.db.query(User).filter_by(login=login).one()
         if check_password(password, user.password):
             return (user.id, None)
     except NoResultFound:
         pass
     return (None, None) # XXX?
Esempio n. 2
0
 def by_credential(cls, env, login, password):
     user = env.db.get(cls, login=login)
     if user and check_password(password, user.password):
         return user.id, None
     return None, u'Неправильный логин или пароль'
Esempio n. 3
0
 def check_password(self, password):
     return check_password(password, self.password)