def is_username_valid(self, username_field):
     userdata = UserData()
     return False if userdata.find_by_prop("username",
                                           username_field) else True
 def is_email_valid(self, email_field):
     userdata = UserData()
     return False if userdata.find_by_prop("email", email_field) else True
예제 #3
0
 def insert_one(user):
     user.password = generate_password_hash(user.password)
     UserData.create_user(user)
예제 #4
0
 def find_by_id(userid):
     user = UserData.find_by_id(userid)
     return Usuario(user["username"], user["email"], user["_id"]) if user else None
예제 #5
0
 def check_password(password, username):
     pwhash = UserData.get_user_password(username)
     return check_password_hash(pwhash, password)
예제 #6
0
 def find_by_username(self, username):
     userdata = UserData()
     return userdata.find_by_username(username)
예제 #7
0
 def insert_one(self, user):
     userdata = UserData()
     userdata.create_user(user)