Example #1
0
def credentials_valid_and_user_registered(email, password):
    """
    Only returns true if the email exists in the datastore,
    and the password is correct.
    """
    #TODO(rushiagr): put all the server-side validation code here
    
    user = UserInfo.get_by_id(email)
    if user is not None and user.password == password:
        return True
    return False
Example #2
0
def email_already_in_db(email):
    user = UserInfo.get_by_id(email)
    if user is not None:
        return True
    return False
Example #3
0
def mys_on(user):
    ui = UserInfo.get_by_id(str(user.user_id()))
    if ui.mys == False:
        ui.mys = True
        ui.put()
Example #4
0
def mys_off(user):
    ui = UserInfo.get_by_id(str(user.user_id()))
    if ui.mys == True:
        ui.mys = False
        ui.put()
        return 'was_true'