create listing if user host
This commit is contained in:
@@ -62,6 +62,9 @@ def dashboard():
|
|||||||
@app.route('/create-listing', methods=['GET', 'POST'])
|
@app.route('/create-listing', methods=['GET', 'POST'])
|
||||||
@login_required
|
@login_required
|
||||||
def create_listing():
|
def create_listing():
|
||||||
|
if not current_user.is_host:
|
||||||
|
return redirect(url_for('home'))
|
||||||
|
|
||||||
if request.method == 'POST':
|
if request.method == 'POST':
|
||||||
title = request.form['title']
|
title = request.form['title']
|
||||||
description = request.form['description']
|
description = request.form['description']
|
||||||
|
|||||||
Reference in New Issue
Block a user