def updateUserRating(userID, increment): user = checkForUser(userID) if user: if user.rating: user.rating += increment else: user.rating = increment user.put() checkForUser(userID, forceRefresh = True)
def getUserRating(userID): user = checkForUser(userID) if user: if user.rating is None: rating = 0 else: rating = user.rating else: rating = 0 return rating