def create_account(): if state.active_account: error_msg("You are already logged in. Use this account.") return print(' ****************** REGISTER **************** ') name = input('What is your name? ') email = input('What is your email? ').strip().lower() password = input('Enter the passphrase : ') confirm_password = input('Retype the passphrase : ') if (name.strip(' ') == '' or email.strip(' ') == '' or password.strip(' ') == ''): error_msg(f"ERROR: All fields are required.") return if (password != confirm_password): error_msg(f"ERROR: Passphrases didn't match.") return old_account, msg = svc.find_account_by_email(email, password) """ above line has error. As msg variable is not used down below.""" if old_account: error_msg(f"ERROR: Account with email {email} already exists.") return state.active_account = svc.create_account(name, email, password) success_msg(f"Created new account with id {state.active_account.id}.")
def create_account(): print(' ****************** REGISTER **************** ') name = input('Your Name? :') email = input('Your e-mail? :') old_account = svc.find_account_by_email(email) if old_account: error_msg(f"ERROR: Account with this email {email} already exists.") return state.active_account = svc.create_account(name, email) success_msg(f"Account created with account id {state.active_account.id}")
def create_account(): if state.active_account: error_msg("You already have an account") return print('\n ********** Register ********** \n') name = input('Enter your name....') email = input('Enter your email....').strip().lower() if services.find_account_by_email(email): error_msg('!! This email is already in use !!') return state.active_account = services.create_account(name, email) success_msg(f'Successfully Created Account For {name} 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() 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}" # pylint: disable=no-member )
def create_account(): print(' ****************** REGISTER **************** ') name = input('Qual o seu nome? ') email = input('Seu email? ').strip().lower() old_account = svc.find_account_by_email(email) if old_account: error_msg(f"ERRO: A conta com o email {email} já existe.") return state.active_account = svc.create_account(name, email) success_msg(f"Nova conta com o id {state.active_account.id} criada com sucesso!")
def create_account(): print(' ****************** REGISTER **************** ') name = input('What is your name? ') email = input('What is your email? ').strip().lower() password = input('Enter the passphrase : ') confirm_password = input('Retype the passphrase : ') if (name.strip(' ')=='' or email.strip(' ')=='' or password.strip(' ')==''): error_msg(f"ERROR: All fields are required") return if (password!=confirm_password): error_msg(f"ERROR: Passphrases didn't match.") return old_account,msg = svc.find_account_by_email(email,password) if old_account: error_msg(f"ERROR: Account with email {email} already exists.") return state.active_account = svc.create_account(name, email, password) success_msg(f"Created new account with id {state.active_account.id}.")