def all_players(): """ Displays the index page of the players submodule which lists all players. """ user = web_token.jwt_cookie_to_user() players = db.all_users() resp = flask.make_response(flask.render_template('allPlayers.html', players=players, user=user)) return resp
def authenticate(email, password): valid_users = db.all_users() for user in valid_users: if email == user['email'] and user['password'] == password: return email return None
def all_users(): if hasattr(current_user, 'role'): role = current_user.get_role() else: role = "" return render_template('all-users.html', users=db.all_users(), role=role)
def login_post(): user = request.form.to_dict() db.insert_info(list(user.values())) print(list(user.values())) users = db.all_users() return render_template('list.html', users=users) #list.html 에 users라는 것을 넘길 것이다
def api_user(name): users = db.all_users() user = [u for u in users if u['name'] == name] if len(user) == 1: return jsonify(user) else: response = jsonify({'message': "Invalid user " + name}) response.status_code = 404 return response
def api_user(name): users = db.all_users() user = [] for u in users: if u['userID'] == name: user.append(u) if len(user) == 1: return jsonify(user) else: response = jsonify({ 'message': "Invalid user "+name }) response.status_code = 404 return response
def list_user(): users = db.all_users() return render_template('list.html', users=users)
def all_users(): return render_template('all-users.html', users=db.all_users())
def list_user(): db.create_table() users=db.all_users() return render_template('list.html',users=users)
def change_user(): userName = input("Enter the username: "******"Enter the desired username: "******"Enter the desired password: "******"Enter the desired Full Name:") editUser(userName, userName2, password2, full_name2) def remove_user(): userName = input("Enter a username to be removed: ") deleteUser(userName) val = 0 while val != "5": print("""please make a selection 1 = List Users 2 = Add User 3 = Edit User 4 = Delete User 5 = Quit""") val = input("Enter Command:") if val == "1": all_users() elif val == "2": new_user() elif val == "3": change_user() elif val == "4": remove_user()
def test_all_users(self): users = db.all_users() self.assertEqual(len(users), 0, "All Users Day 0 - Unexpected extra users.")
def test_all_users(self): users = db.all_users() self.assertEqual( len(users), 4, "All Users Day 1 - Unexpected number of users in day 1.")
def api_users(): users=db.all_users() return jsonify(users)