Exemple #1
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(f"ERROR: Account with Email {email} already exists.")
    state.active_account = svc.create_account(name, email)
    success_msg(f"Created new account with ID {state.active_account.id}.")
def create_account():
    print(' ****************** REGISTER **************** ')
    name = input("what is your name..?")
    email = input ("what is your password..?")

    old_account = svc.find_account_by_email(email)
    if old_account:
        error_msg(f"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}.")
def create_account():
    print(' ****************** REGISTER **************** ')
    name = input("Enter a name : ")
    email = input("Enter your email : ")

    old_account = svc.find_account_by_email(email)
    if old_account:
        print(f'ERROR:Account with email {email} already exists')
        return

    state.active_account = svc.create_account(name, email)
    print(f"created new account with {state.active_account.id}")
def create_account():
    print(' ****************** REGISTER **************** ')

    name = input('Name: ')
    email = input('Email: ').strip().lower()

    if svc.find_account_by_email(email):
        error_msg(f"Account with email '{email}' already exists")
        return

    state.active_account = svc.create_account(name, email)
    success_msg(f"Account with id '{state.active_account.id}' registered successfully")
Exemple #5
0
def create_account():
    print(' ****************** REGISTER **************** ')
    # TODO: Get name & email
    # TODO: Create account, set as logged in.
    name = input("What is your name ")
    email = input("What is your email ").strip().lower()

    old = svc.find_account_by_email(email)
    if old:
        error_msg(f"Error: Account with same email {email} exists")
        return
    state.active_account = svc.create_account(name, email)
    success_msg(f"Created account with Id {state.active_account.id}")
def create_account():
    print(' ****************** REGISTER **************** ')

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

    check_account = svc.find_account_by_email(email)
    if check_account:
        error_msg(f"ERROR: Account with email {email} already exist.")
        return

    state.active_account = svc.create_account(name, email)
    success_msg(f"Created an account with id {state.active_account.id}.")
Exemple #7
0
def create_account():
    print(' ****************** REGISTER **************** ')

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

    old_account = svc.find_account_by_email(email)
    if old_account:
        error_msg(f'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}.')
Exemple #8
0
def create_account():
    print(' ****************** REGISTER **************** ')
    # done: Get name & email
    name = input('name')
    email = input('email')

    # Done: Create account, set as logged in.

    old_acount = svc.find_account_by_email(email)
    if old_acount:
        error_msg("Error, that email already exists")
        return
    state.active_account = svc.create_account(name, email)
    success_msg(f"created an account with id {state.active_account.id}")
Exemple #9
0
def log_into_account():
    print(' ******************** Select user ******************** ')

    for user_tuple in set_up_globals.users:
        name = user_tuple[0]
        email = user_tuple[1]
        if not svc.find_account_by_email(email):
            svc.create_account(name, email)

    users = svc.get_users()
    print()
    for idx, u in enumerate(users):
        print('{}. {} (email: {})'.format(
            idx + 1,
            u.name,
            u.email
        ))

    message = f"\nPlease enter a number between 1 and {str(len(users))} or 'x' to exit: "
    response = input(message)
    if response in set_up_globals.exitResponseList:
        return response

    try:
        user = users[int(response) - 1]
    except (IndexError, ValueError):
        error_msg(message + '\n')
        return response

    email = user.email
    account = svc.find_account_by_email(email)
    if not account:
        error_msg(f'Could not find account with email {email}.')
        return response

    state.active_account = account
    success_msg('Logged in successfully.')
Exemple #10
0
def create_account():
    print(' ****************** REGISTER **************** ')

    first_name = input('What is your first name? ')
    last_name = input('What is your last name? ')
    username = input(
        'What would you like your username to be? ').strip().lower()
    email = input('What is your email? ').strip().lower()
    account_exists = svc.find_account_by_email(email)
    if account_exists:
        error_msg(f"ERROR: Account with email {email} already exists.")
        return
    state.active_account = svc.create_account(username, first_name, last_name,
                                              email)
    success_msg(f"Created new account with id {state.active_account.id}.")
def create_account():
    print(' ****************** REGISTER **************** ')

    name = input('What is your name? ')
    email = input('What is your email? ').strip().lower()
    #.lower() - makes everything lower case
    #. strip() - removes spaces

    old_account = svc.find_account_by_email(email)
    if old_account:
        error_msg(f"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}.")
def create_account():
    print(' ****************** REGISTER **************** ')
    name = input('Enter your Name : ')

    emailregex = re.compile(
        r'^([a-zA-Z0-9_\-.]+)@([a-zA-Z0-9_\-.]+)\.([a-zA-Z]{2,5})$')
    email = emailregex.search(input('Enter your Email : ').strip().lower())

    if not email:
        error_msg(f'Not an Email')
        return

    old_account = svc.find_account_by_email(email.group())
    if old_account:
        error_msg(f'Account with email - {email} already exists.')
        return

    state.active_account = svc.create_account(name, email.group())
    success_msg(
        f'New Account {state.active_account.id} with email - {email.group()} created at {datetime.datetime.now()}'
    )