def post_link(): check_user_is_logged() # POST request if request.method == 'POST': # Create the link link = Link(request.form['url']) link.comment = request.form['comment'] link.user = g.user # Update db db_session.add(link) db_session.commit() return redirect(url_for('home')) # GET Request else: return render_template('post.html', user=g.user)
def post_link(): check_user_is_logged() # POST request if request.method == "POST": # Create the link link = Link(request.form["url"]) link.comment = request.form["comment"] link.user = g.user # Update db db_session.add(link) db_session.commit() return redirect(url_for("home")) # GET Request else: return render_template("post.html", user=g.user)
def post_link(): check_user_is_logged() # POST request if request.method == 'POST': # Create the link link = Link(request.form['url']) link.comment = request.form['comment'] link.user = g.user # Update db db_session.add(link) db_session.commit() return redirect(url_for('home')) # GET Request else: return render_template('post.html', user = g.user)