コード例 #1
0
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.')
コード例 #2
0
ファイル: program_hosts.py プロジェクト: racs93/snake_bnb
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}.")
コード例 #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")
コード例 #4
0
def reload_account():
    global active_account
    if not active_account:
        return
    active_account = svc.find_account_by_email(active_account.email)