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!")
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
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)
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!")
def checkCred(username, password): user = User.all().filter("username =", username).get() if user: passMatch = testHash(user.password, password) return passMatch return False