Exemplo n.º 1
0
def createUser(username, password, email=None):
    password = makeHash(password)
    exists = User.all().filter("username ="******"User " + username + " taken."
    if email:
        user = User(username=username, password=password, email=email, rating=1200.0)
    else:
        user = User(username=username, password=password, rating=1200.0)
    user.put()
    logging.info("User: "******" created!")
Exemplo n.º 2
0
def checkCred(username, password):
    user = User.all().filter("username =", username).get()
    if user:
        passMatch = testHash(user.password, password)
        if passMatch:
            return True, user.username, user.rating
    return False, None, None
Exemplo n.º 3
0
def updateRating(username, userRating, qK, qRating, result):
    user = User.all().filter("username =", username).get()
    question = Question.get(qK)
    user.rating, question.rating = getNewRatings(userRating, qRating, result)
    user.put()
    question.put()
    return str(user.rating)
Exemplo n.º 4
0
Arquivo: dbfunc.py Projeto: Mb01/yasai
def createUser(username, password, email=None):
    password = makeHash(password)
    exists = User.all().filter("username ="******"User " + username + " taken."
    if email:
        user = User(username=username, password=password, email=email)
    else:
        user = User(username=username, password=password)
    user.put()
    logging.info(username + " created!")
Exemplo n.º 5
0
Arquivo: dbfunc.py Projeto: Mb01/yasai
def checkCred(username, password):
    user = User.all().filter("username =", username).get()
    if user:
        passMatch = testHash(user.password, password)
        return passMatch
    return False
Exemplo n.º 6
0
Arquivo: dbfunc.py Projeto: Mb01/yasai
def checkCred(username, password):
    user = User.all().filter("username =", username).get()
    if user:
        passMatch = testHash(user.password, password)
        return passMatch
    return False