def add_user(): """ Inserts a user into the database. Assigns them a random id (1-1000) input: 'user_name' : form data string """ db = get_db() new_user = user.User(random.randint(0, 1000), request.form["user_name"].strip()) user.insert_user_into_db(new_user, db) return view.get_user_list_html(db)
def index(): db = get_db() return render_template('index.html', users_html=view.get_user_list_html(db))