def log_into_account():
    print(' ****************** LOGIN **************** ')

    email = input('What is your email? ').strip().lower()
    account = svc.find_account_by_email(email)

    if not account:
        error_msg(f'Could not find account with email {email}.')
        return

    state.active_account = account
    success_msg('Logged in successfully.')
Ejemplo n.º 2
0
def create_account():
    print(' ****************** REGISTER **************** ')

    name = input('What is your name? ')
    email = input('What is your email? ').strip().lower()

    old_account = svc.find_account_by_email(email)
    if old_account:
        error_msg("ERROR: Account with email {email} already exists.")
        return
    state.active_account = svc.create_account(name, email)
    success_msg(f"Created new account with id {state.active_account.id}.")
Ejemplo n.º 3
0
def log_into_account():
    print(' ****************** LOGIN **************** ')

    # get email at first
    email = input("Enter your email").strip().lower()
    account = svc.find_account_by_email(email)

    if not account:
        error_msg(f"Couldn't find the user with email {email}")
        return

    state.active_account = account
    success_msg("Login Successful")
Ejemplo n.º 4
0
def reload_account():
    global active_account
    if not active_account:
        return
    active_account = svc.find_account_by_email(active_account.email)