Ejemplo n.º 1
0
 def add(self, form_data):
     user = User(form_data['username'], form_data['first_name'], form_data['last_name'],
                 utils.create_password(form_data['password']), form_data['email'])
     try:
         db.session.add(user)
         db.session.commit()
         return True
     except Exception, e:
         logger.error(e)
         return False
Ejemplo n.º 2
0
 def validate_user(self, form_data):
     return User.query.filter_by(username=form_data['username'], password=utils.create_password(form_data['password'])).first()