def login(email, password): errors = {} user = get_user_by_email(email) if not user or not user.enabled: errors["email"] = get_response_error("WRONG_EMAIL") if errors: return False, None, errors return execute_login(user, password)
def register(email, password): errors = {} user = get_user_by_email(email) if user: errors["email"] = get_response_error("EMAIL_ALREADY_REGISTERED") if errors: return False, None, errors return execute_register(email, password)