From c8b46db3b70a96cbc998dab132bde12a9198ae16 Mon Sep 17 00:00:00 2001 From: 3err0 Date: Wed, 8 Jan 2025 15:17:39 +0800 Subject: [PATCH] create listing if user host --- routes.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/routes.py b/routes.py index 02d3a2c..71852c0 100644 --- a/routes.py +++ b/routes.py @@ -62,6 +62,9 @@ def dashboard(): @app.route('/create-listing', methods=['GET', 'POST']) @login_required def create_listing(): + if not current_user.is_host: + return redirect(url_for('home')) + if request.method == 'POST': title = request.form['title'] description = request.form['description']