示例#1
0
 def __init__(self, username, password, usertype, credits):
     self.username = username
     #self.email = email
     self.password = bcrypt.generate_password_hash(password).decode('utf-8')
     #self.confirmed_email = False
     #self.confirmed_email_on = None
     #self.confirmed_phone = False
     #self.confirmed_phone_on = None
     self.usertype = usertype
     self.credits = credits
示例#2
0
 def update(self, username, email, password, phone):
     if (username):
         self.username = username
     if (email):
         self.email = email
     if (phone):
         self.phone = phone
     if (password):
         self.password = bcrypt.generate_password_hash(password).decode(
             'utf-8')
     db.session.commit()
示例#3
0
 def __init__(self, username, password):
     self.username = username
     #self.email = email
     self.password = bcrypt.generate_password_hash(password).decode('utf-8')
示例#4
0
    def updatePassword(self, password):

        if (password):
            self.password = bcrypt.generate_password_hash(password).decode(
                'utf-8')
        db.session.commit()