예제 #1
0
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)
예제 #2
0
파일: run.py 프로젝트: Castlely/AGILE
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)
예제 #3
0
파일: run.py 프로젝트: Castlely/AGILE
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)